#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;

long long n, m, q;
vector<int> a;

int f(int r){
    int w = r*7, res = 0;
    vector<bool> vsd(w, false);
    for(int i=0;i<q;i++){
        int v = a[i];
        while(v < w){
            vsd[v] = true;
            v += m;
        }
    }
    for(int i=0;i<w;i++){
        if(vsd[i]) continue;
        res++;
        queue<int> q;
        q.push(i);
        while(!q.empty()){
            int v = q.front();
            q.pop();
            if(vsd[v]) continue;
            vsd[v] = true;
            if(v%7 > 0 && !vsd[v-1]) q.push(v-1);
            if(v%7 < 6 && !vsd[v+1]) q.push(v+1);
            if(v/7 > 0 && !vsd[v-7]) q.push(v-7);
            if(v+7 < w && !vsd[v+7]) q.push(v+7);
        }
    }
    return res;
}

int main(void){
    cin >> n >> m >> q;
    a.assign(q, 0);
    for(int i=0;i<q;i++) cin >> a[i];
    long long x = m, y;
    if(m%7 == 0) x = m / 7;
    y = n / x;
    long long b = f(x);
    long long a = f(x*2) - b;

    cout << b + a * (y-1) << endl;

}
