a = list(map(int, input().split()))[:4]
c = 0
b = []
for i in a:
    if i not in b:
        b.append(i)
print(4 - len(b))

37e63a775db24c1b41f74bcd129d1877d4e48458
<mask token>

<mask token>
for i in a:
    if i not in b:
        b.append(i)
print(4 - len(b))

a = list(map(int, input().split()))[:4]
c = 0
b = []
for i in a:
    if i not in b:
        b.append(i)
print(4 - len(b))
