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

#define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++)
#define FORD(i, a, b) for (int i = (a), _b = (b); i >= _b; i--)

using ll = long long;

template<typename X, typename Y>
bool chmax(X& a, Y b) { return (a < b) ? a = b, 1 : 0; }
template<typename X, typename Y>
bool chmin(X& a, Y b) { return (a > b) ? a = b, 1 : 0; }

int M, N, Q;
vector<vector<int>> A;

void solve() {
    cin >> M >> N >> Q;
    A.assign(M + 5, vector<int>(N + 5, 0));
    while (Q--) {
        int x, y, u, v; cin >> x >> y >> u >> v;
        A[x][y] ^= 1; A[u + 1][v + 1] ^= 1;
        A[x][v + 1] ^= 1; A[u + 1][y] ^= 1;
    }
    int ans = 0;
    FOR(r, 1, M) FOR(c, 1, N) {
        A[r][c] ^= A[r - 1][c] ^ A[r][c - 1] ^ A[r - 1][c - 1];
        ans += A[r][c];
    }
    cout << ans << "\n";
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    // freopen("LIGHT.INP", "r", stdin);
    // freopen("LIGHT.OUT", "w", stdout);

    int tests = 1; // cin >> tests;
    while (tests--) solve();

    #ifdef LOCAL
    cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}
