#include<iostream>
using namespace std;


bool isIn(long arr[],long sizearr,long num){
    for(long i = 0; i < sizearr;i++){
        if(arr[i] == num){
            return true;
        }
    }
    return false;
}

int main(){
    long n,k;
    cin >> n >> k;

    long *gnomes = new long[n-k];
    long *nGnomes = new long[k];

    for(long i = 0;i < k;i++){
        cin >> nGnomes[i];
    }

    long g = 0;
    for(long i = 1;i <= n;i++){
        if(!isIn(nGnomes,k,i)){
            gnomes[g] = i;
            g++;
        }
    }

    long l = 0;

    long *res = new long[l];

    for(long i = 0; i < n-k;i++){
        for(long j = i; j < n-k;j++){
            if(!isIn(res,l,gnomes[i]+gnomes[j])){
                res[l] = gnomes[i]+gnomes[j];
                l++;
            }
        }
    }
    cout <<  l;
    return 0;
}
