import sys

def find_longest_sublist(lst):
    if not lst:
        return 0

    start = 0
    max_len = 0
    max_start = 0
    int_index_map = {}
    for end in range(len(lst)):
        if lst[end] in int_index_map and int_index_map[lst[end]] >= start:
            start = int_index_map[lst[end]] + 1
        int_index_map[lst[end]] = end
        if end - start + 1 > max_len:
            max_len = end - start + 1
            max_start = start
    return max_len

if __name__ == "__main__":
    inputs = input().split(' ')
    print(find_longest_sublist(inputs))