//对于复杂的题 先找规律 再用计算机语言解答
#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
int m, n;
cin >> m >> n;
int i;
cin >> i;
int nut = 0;
while (i--)
{
int x, y;
cin >> x >> y;
int cx = m / 2 + 1, cy = n / 2 + 1;
if (abs(x - cx) + abs(y - cy) <= max(m, n) / 2) nut++;
}
cout << nut;
return 0;
}