n = int(input()) lt = list(map(int,input().split())) class Node: def __init__(self, val, next=None): self.val = val self.next = next total = lt[0] head = Node(lt[0]) for i in lt[1:]: total += i head.next = Node(i) head = head.next print(total)