import sys

with open(sys.argv[1], 'r') as test_cases:
    for test in test_cases:
        numbers = test.split()
        dictionary = dict()
        for number in numbers:
            if(number in dictionary):
                dictionary[number] += 1
            else:
                dictionary.update({number: 0})
        keys = dictionary.keys()
        counter = 0
        answer = 0
        smallest = 0
        for key in keys:
            if(dictionary.get(key) == 0):
                if(counter == 0):
                    smallest = int(key)
                    counter += 1
                else:
                    if(int(key) < smallest):
                        smallest = int(key)
        if(smallest != 0):
            answer = numbers.index(str(smallest)) + 1
        print(answer)