#include <stdio.h>
#include<stdlib.h>
typedef struct point{
int val;
struct point *next;
}link;
int main()
{
link *head,*p;
head=(link*)malloc(sizeof(link));
head->next=NULL;
int n;
scanf("%d",&n);
int *array=(int *)malloc(n*sizeof(int));
int i;
p=head;
for(i=0;i<n;i++)
{
scanf("%d",&array[i]);
}
for(i=0;i<n;i++)
{
link*s=(link*)malloc(sizeof(link));
s->val=array[i];
s->next=NULL;
p->next=s;
p=s;
}
int sum=0;
p=head;
while(p->next!=NULL)
{
sum+=p->next->val;
p=p->next;
}
printf("%d",sum);
return 0;
}