from collections import Counter def main(): fruits = Counter(map(int, input().split())) match len(fruits): case 1: print(list(fruits.keys())[0]) case 3: print(6 - sum(fruits.keys())) case 2: print(list(filter(lambda elm: fruits[elm] == 1, fruits))[0]) if __name__ == "__main__": main()