import sys input = lambda: sys.stdin.readline().rstrip() from collections import Counter ################## A = list(map(int, input().split())) c = Counter(A) if len(c) == 1: print(A[0]) elif len(c) == 2: if c[0] == 1: print(0) elif c[1] == 1: print(1) elif c[2] == 1: print(2) else: print(3) else: print(list({0,1,2,3}-set(A))[0])