#include <bits/stdc++.h>
using namespace std;
struct pt {
  int x, y;
  pt() {}
  pt(int _x, int _y) { x = _x, y = _y; }
  long long operator*(const pt& rhs) const {
    return (long long)x * rhs.y - (long long)y * rhs.x;
  }
  pt operator-(const pt& rhs) const { return pt(rhs.x - x, rhs.y - y); }
} a[501], b[501];
int n, m;
int dp[501][501];
int main() {
  cin >> n >> m;
  for (int(i) = int(1); i <= int(n); i++) cin >> a[i].x >> a[i].y;
  for (int(i) = int(1); i <= int(m); i++) cin >> b[i].x >> b[i].y;
  a[0] = pt(-1e9 - 1, -1e9 - 1);
  for (int(i) = int(1); i <= int(n); i++) {
    for (int(j) = int(1); j <= int(n); j++) {
      if ((a[0] - a[i]) * (a[j] - a[i]) <= 0) continue;
      for (int(k) = int(1); k <= int(m); k++) {
        if ((a[0] - a[i]) * (b[k] - a[0]) >= 0 &&
            (b[k] - a[i]) * (a[j] - b[k]) >= 0 &&
            (a[0] - b[k]) * (a[j] - a[0]) >= 0)
          dp[i][j]++;
      }
      dp[j][i] = -dp[i][j];
    }
  }
  int ans = 0;
  for (int(i) = int(1); i <= int(n); i++) {
    for (int(j) = int(i + 1); j <= int(n); j++) {
      for (int(k) = int(j + 1); k <= int(n); k++) {
        if (dp[i][j] + dp[j][k] + dp[k][i] == 0) ans++;
      }
    }
  }
  cout << ans;
}
