For this Question: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies.
Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.”
Compute the maximum number of people who could be telling the truth.The first line contains a single integer n (1 ≤ n ≤ 10^3). 
Each of the next n lines contains two space-separated integers a<sub>i</sub> and b<sub>i</sub>
(0 ≤ a<sub>i</sub> ≤ b<sub>i</sub> ≤ n).Print, on a single line, the maximum number of people who could be telling the truth. If the given
set of statements are inconsistent, print -1 instead.Sample input
3
1 1
2 3
2 2

Sample output 
2

Sample input
8
0 1
1 7
4 8
3 7
1 2
4 5
3 7
1 8

Sample output
-1, I have written this Solution Code: n=int(input())
a=[0]*(n+1)
m=0
for i in range(n):
	b=[int(k) for k in input().split()]
	for j in range(b[0],b[1]+1):
		a[j]+=1;
for i in range(n,0,-1):
	if a[i]==i:
		print(i)
		exit()
print(-1), In this Programming Language: Python, Now tell me if this Code is compilable or not?