#include <bits/stdc++.h>
using namespace std;
long long f[501][501];
pair<long long, long long> red[501], xanh[501];
int main() {
  int n, m, ans = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> red[i].first >> red[i].second;
  for (int i = 1; i <= m; i++) cin >> xanh[i].first >> xanh[i].second;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (red[i].first < red[j].first) {
        for (int k = 1; k <= m; k++)
          if (red[i].first < xanh[k].first && xanh[k].first <= red[j].first &&
              (red[j].first - red[i].first) * (xanh[k].second - red[i].second) <
                  (xanh[k].first - red[i].first) *
                      (red[j].second - red[i].second))
            f[i][j]++;
        f[j][i] = -f[i][j];
      }
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      for (int k = j + 1; k <= n; k++)
        if (f[i][j] + f[j][k] == f[i][k]) ans++;
  cout << ans;
}
