sum=1 N=int(input()) for i in range(N-1): a,b=map(int,input().split()) sum+=b print(sum)