//package A;

import java.util.Scanner;

public class Task985A {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();
        int ind = 1;
        int kol = 0;
        for(int i = 0; i<n/2; i++){
            int a = scn.nextInt();
            kol+=a-ind;
            ind+=2;
        }
        System.out.println(kol);
    }
}
