For this Question: Anya owns N triplets of integers (A<sub>i</sub>, B<sub>i</sub>, C<sub>i</sub>), for each i from 1 to N. She asks you to find a sequence of integers which satisfies the following conditions:

1. The sequence contains at least C<sub>i</sub> distinct integers from the closed interval [A<sub>i</sub>, B<sub>i</sub>], for each i from 1 to N.
2. Out of all sequences satisfying the first condition, choose a sequence with the minimum possible number of elements.

For simplicity, she asks you to just print the length of such a sequence.The first line of the input contains a single integer N denoting the number of triplets. 
Then N lines follow, where the i<sup>th</sup> line contains three integers A<sub>i</sub>, B<sub>i</sub>, C<sub>i</sub> for each i from 1 to N.

<b> Constraints: </b>
1 ≤ N ≤ 2000
1 ≤ A<sub>i</sub> ≤ B<sub>i</sub> ≤ 2000
0 ≤ C<sub>i</sub> ≤ B<sub>i</sub> - A<sub>i</sub> + 1Print a single integer — the minimum possible sequence length.Sample Input 1:
1
1 3 3
Sample Output 1:
3

Sample Explanation 1:
Since there are only 3 elements in the closed interval [1,3], and we need to take 3 of them, clearly the smallest possible length is 3.

Sample Input 2:
2
1 3 1
3 5 1
Sample Output 2:
1

Sample Explanation 2:
We can take the sequence consisting of a single element {3}., I have written this Solution Code: l = [0]*2001
k = []
n = int(input())
for i in range(n):
    a,b,c = map(int,input().split())
    k.append([b,(a,c)])
k.sort()
for b,aa in k:
    a = aa[0]
    c = aa[1]
    cnt = 0
    for i in range(b,a-1,-1):
        if l[i]:
            cnt+=1
    if cnt>=c:
        continue
    else:
        for i in range(b,a-1,-1):
            if not l[i]:
                l[i]=1
                cnt+=1
            if cnt==c:
                break
print(sum(l)), In this Programming Language: Python, Now tell me if this Code is compilable or not?