k,a[999],i;main(m){for(;gets(&k)?++a[strlen(&k)]:i++<998?m=a[i]