Basil often travels to international programming contests held in different cities. After arriving in Byteland he noticed that he had seen a very similar subway map somewhere before. After a moment of thought he understood why: the subway in Byteland looks a lot like the subway in Bytowia. In both cities the subway tunnels form a tree. Every tunnel can be traveled in both directions, and there is exactly one way to get from one station to another using tunnels.
To prove to his friend Peter that the two maps really are similar, Basil wants to find a connected set of k stations a1,a2,…,ak in Byteland and a connected set of k stations b1,b2,…,bk in Bytowia such that for every i and j, Byteland has a tunnel between ai and aj if and only if Bytowia has a tunnel between bi and bj. A set of stations is connected if you can travel from each station of the set to any other station of the set using only stations from that set as intermediate stops.
Help Basil find similar connected sets with the largest number of stations.