#include <bits/stdc++.h>
using namespace std;
long long n, m, rx1, rx2, ry1, ry2, px, py, ans = 0;
long long rx[501], ry[501], bx[501], by[501], cnt[501][501];
bool fix(int x1, int y1, int x2, int y2, int x3, int y3) {
  long long dx1 = x2 - x1;
  long long dy1 = y2 - y1;
  long long dx2 = x3 - x1;
  long long dy2 = y3 - y1;
  return dx1 * dy2 - dx2 * dy1 > 0;
}
inline bool check(int a, int b, int c) {
  long long ml = a;
  long long mr = b;
  long long oth = c;
  long long v[3] = {a, b, c};
  for (long long i = 0; i < 3; i++) {
    if (rx[v[i]] < rx[ml]) ml = v[i];
    if (rx[v[i]] > rx[mr]) mr = v[i];
  }
  for (long long i = 0; i < 3; i++) {
    if (v[i] == mr || v[i] == ml) continue;
    oth = v[i];
  }
  long long ret = -cnt[ml][mr] + cnt[oth][mr] + cnt[ml][oth];
  return ret == 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (long long i = 0; i < n; i++) cin >> rx[i] >> ry[i];
  for (long long i = 0; i < m; i++) cin >> bx[i] >> by[i];
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      if (i == j) continue;
      rx1 = rx[i];
      rx2 = rx[j];
      ry1 = ry[i];
      ry2 = ry[j];
      if (rx1 > rx2) {
        swap(rx1, rx2);
        swap(ry1, ry2);
      } else if (rx1 == rx2)
        continue;
      for (long long k = 0; k < m; k++) {
        px = bx[k];
        py = by[k];
        if (rx1 < px && px <= rx2) {
          if (!fix(rx1, ry1, rx2, ry2, px, py)) {
            cnt[i][j]++;
            cnt[j][i]++;
          }
        }
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      if (i == j) continue;
      for (long long k = j + 1; k < n; k++) {
        if (k == i || k == j) continue;
        if (check(i, j, k)) ans++;
      }
    }
  }
  cout << ans;
}
