정말 집중의 차이인가? 5분이면 풀 문제를;;;
arr=[0]*4
arr= list(map(int, input().split()))
arr.sort(reverse=True)
cnt = 0
def plus(a,b,c):
global cnt
# if cnt > 100:
# return 0
# print("10:",a, b, c, cnt)
if a!=b:
cnt+=1
# print("00:",a, b, c, cnt)
return plus(a, b+1, c+1)
elif a==b and b!=c and a >c:
cnt+=1
# print("01:",a, b, c, cnt)
return plus(a, b, c+2)
elif c > a or c> b:
cnt+=1
# print("02:",a, b, c, cnt)
return plus(a+1, b+1, c)
plus(arr[0], arr[1], arr[2])
print(cnt)