#include <iostream>
#include <bits/stdc++.h>
using namespace std;


int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    long long  N,absent;
    int K;
    cin >> N >> K;
    unsigned long long x,index;
    x=(N-K+1)*(N-K)/2;
    long long families[200000];
    for (long long i=0; i<N; i++)
        families[i]=i+1;
    families[N]=0;
    for (int i=0; i<K; i++)
    {
        cin >> absent;
        families[absent-1]=0;
        //for (long long j=absent-1-i; j<N-1; j++)
        //{
            //families[j]=families[j+1];
        //}
        //N--;
    }
     for (long long i=N-1; i>=0; i--)
     {
         if (families[i]==0)
         {
            for (long long j=i; j<N-1; j++)
                families[j]=families[j+1];
            N--;
         }
     }
     //for (long long i=0; i<N; i++)
        //cout << families[i] <<  " dd" << endl;
    index=0;
    unsigned long long heights[x];
    for(unsigned long long i=0; i<N; i++)
    {
        for(unsigned long long j=i; j<N; j++)
            {
                heights[index]=families[i]+families[j];
                index++;
            }
    }
    //for(unsigned long long i=0; i<x; i++)
        //cout << heights[i] << " ; ";
    //cout<< endl;
    int counter,answer;
    answer=0;
    for(unsigned long long i=0; i<x; i++)
    {
        counter=0;
         for(unsigned long long j=0; j<x; j++)
        {
            if (heights[i]==heights[j])
                counter++;
        }
        if (counter==1)
            answer++;
        else heights[i]=0;
    }
    cout << answer;


    return 0;
}
