from itertools import * from functools import * from collections import * from math import * from heapq import * import sys input = sys.stdin.readline A = list(map(int,input().split())) if len(set(A)) == 1: print(A[0]) elif len(set(A)) == 2: c = Counter(A) for k,v in c.items(): if v == 1: print(k) else: print(6-sum(A))