#include <bits/stdc++.h>
using namespace std;
bool orientation(const pair<int, int>& a, const pair<int, int>& b,
                 const pair<int, int>& c) {
  int res = (b.second - a.second) * (c.first - b.first) -
            (b.first - a.first) * (c.second - b.second);
  return (res > 0) ? false : true;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> reds(N);
  vector<pair<int, int>> blues(M);
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    reds[i] = make_pair(a, b);
  }
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    blues[i] = make_pair(a, b);
  }
  sort(reds.begin(), reds.end());
  vector<int> same(N, 0);
  for (int a = 0; a < N; a++) {
    for (int b = 0; b < M; b++) {
      if (blues[b].first == reds[a].first) {
        same[a] = reds[a].second > blues[b].second;
        break;
      }
    }
  }
  vector<vector<int>> below(N, vector<int>(N));
  int counter = 0;
  for (int a = 0; a < N - 1; a++) {
    for (int b = a + 1; b < N; b++) {
      if (reds[a].first == reds[b].first) {
        below[a][b] = 0;
        continue;
      }
      double slope = ((double)reds[a].second - reds[b].second) /
                     (reds[a].first - reds[b].first);
      double y = reds[a].second - slope * reds[a].first;
      int mi = min(reds[a].first, reds[b].first);
      int ma = max(reds[a].first, reds[b].first);
      int count = 0;
      for (int c = 0; c < M; c++) {
        if (blues[c].first > mi && blues[c].first < ma &&
            blues[c].second < y + blues[c].first * slope) {
          count++;
        }
      }
      if (reds[a].first > reds[b].first) {
        below[a][b] = -count;
        below[b][a] = count;
      } else {
        below[a][b] = count;
        below[b][a] = -count;
      }
    }
  }
  int ans = 0;
  int sum = 0;
  for (int a = 0; a < N - 2; a++) {
    for (int b = a + 1; b < N - 1; b++) {
      for (int c = b + 1; c < N; c++) {
        if (orientation(reds[a], reds[b], reds[c])) {
          sum = below[a][c] + below[c][b] + below[b][a];
          if (reds[b].first > reds[a].first) {
            if (reds[c].first <= reds[a].first) {
              sum -= same[a];
            } else if (reds[c].first >= reds[b].first) {
              sum -= same[b];
            } else {
              sum += same[c];
            }
          } else {
            sum += same[b];
          }
        } else {
          sum = below[a][b] + below[b][c] + below[c][a];
          if (reds[b].first < reds[a].first) {
            if (reds[c].first >= reds[a].first) {
              sum -= same[a];
            } else if (reds[c].first <= reds[b].first) {
              sum -= same[b];
            } else {
              sum += same[c];
            }
          } else {
            sum += same[b];
          }
        }
        if (sum == 0) {
          ans++;
        }
      }
    }
  }
  cout << ans << "\n";
};
