1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
a = int(input())
b = input().split()
b = [int(i) for i in b]
b.sort()
c = [i+1 for  i in range(a)]


if b == c:
    print(1)
else:
    print(2)