#include<stdio.h>
int main()
{ 
  int n;
  long sum;
  scanf("%d",&n);
  long value;
  for(int i=0;i<n;i++)
  {
    scanf("%li",&value);
    sum+=value;
  }
  printf("%li",sum);
  return 0;
}
Sample input
5
1000000001 1000000002 1000000003 1000000004 1000000005
What is the mistake in this program?
I am getting the sum as 5004198847.
It should be 5000000015.
 
    