https://www.acmicpc.net/problem/10797
n=int(input()) a,b,c,d,e=map(int,input().split()) count=0 if n==a: count+=1 if n==b: count+=1 if n==c: count+=1 if n==d: count+=1 if n==e: count+=1 print(count)