#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main ()
{
  int N;
  int* vi=NULL;
  float potion=0;
  scanf("%d",&N);
  vi=malloc(N*sizeof(int));
  for(int i=0;i<N;i++)
  {
    scanf("%d",&vi[i]);
    potion+=(vi[i]+vi[i+1])/2;
  }
  printf("%f",potion);
  return 0;

}
