#include <iostream>
#include <stdio.h>
#include <set>
#include <vector>
#include <cmath>

using namespace std;

#define MAXK 160000100
#define MAXN 1000100

int n, k, res, x;
int K[2*MAXN];
int N[MAXN];

int main(void)
{
    cin >> n >> k;
    for (int i=0; i<k; i++) { cin >> x; K[x] = -1; }

    for (int i=0; i<min(n, MAXN); i++)
        for (int j=i; j<min(n, MAXN); j++)
            if ((K[i] != -1) && (K[j] != -1))
                N[i+j] = 1;

    for (int i=0; i<MAXN; i++) if (N[i] == 1) res++;
    cout << res << endl;

    return 0;
}
/*
#include <iostream>
#include <stdio.h>
#include <set>
#include <vector>
#include <cmath>

using namespace std;

#define MAXK 160000100
#define MAXN 1000100

int n, k, res, x;
int K[2*MAXN];
int N[MAXN];

int main(void)
{
    cin >> n >> k;
    for (int i=0; i<k; i++) { cin >> x; K[x] = -1; }

    for (int i=0; i<min(n, MAXN); i++)
        for (int j=i; j<min(n, MAXN); j++)
            if ((K[i] != -1) && (K[j] != -1))
                N[i+j] = 1;

    for (int i=0; i<MAXN; i++) if (N[i] == 1) res++;
    cout << res << endl;

    return 0;
}
*/
