while 1:exec"a=raw_input().split();i=k"*2+"=100\nfor x in a:k-=x==ka[i-k]\ni+=k>49;k"*49;print k