# tenka1-2017-beginnerB - Different Distribution

def main():

    N, *AB = list(map(int, open(0).read().split()))

    A = [(i, j) for i, j in zip(*[iter(AB)] * 2)]

    A.sort()

    ans = sum(A[-1])

    print(ans)





if __name__ == "__main__":

    main()
# tenka1-2017-beginnerB - Different Distribution

def main():

    N, *AB = list(map(int, open(0).read().split()))

    A = max(list(zip(*[iter(AB)] * 2)))

    ans = sum(A)

    print(ans)





if __name__ == "__main__":

    main()
# tenka1-2017-beginnerB - Different Distribution
def main():
    N, *AB = list(map(int, open(0).read().split()))
    A = [(i, j) for i, j in zip(*[iter(AB)] * 2)]
    A.sort()
    ans = sum(A[-1])
    print(ans)


if __name__ == "__main__":
    main()

# tenka1-2017-beginnerB - Different Distribution
def main():
    N, *AB = list(map(int, open(0).read().split()))
    A = max(list(zip(*[iter(AB)] * 2)))
    ans = sum(A)
    print(ans)


if __name__ == "__main__":
    main()

-    A = [(i, j) for i, j in zip(*[iter(AB)] * 2)] -    A.sort() -    ans = sum(A[-1]) +    A = max(list(zip(*[iter(AB)] * 2))) +    ans = sum(A)