#include <bits/stdc++.h>
using namespace std;
struct point {
  double x, y;
} b[10001], r[10001], O;
int n, m, f[1001][1001];
point operator+(point a, point b) {
  point c;
  c.x = a.x + b.x, c.y = a.y + b.y;
  return c;
}
point operator-(point a, point b) {
  point c;
  c.x = a.x - b.x, c.y = a.y - b.y;
  return c;
}
double operator*(point a, point b) { return (a.x * b.y - a.y * b.x); }
inline bool cmp(point a, point b) { return ((a - O) * (b - O) > 0); }
int main() {
  O.x = -123545123123, O.y = 12312334526129;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf", &r[i].x, &r[i].y);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%lf%lf", &b[i].x, &b[i].y);
  }
  sort(r + 1, r + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      for (int k = 1; k <= m; k++) {
        if ((r[i] - b[k]) * (r[j] - b[k]) > 0 &&
            (r[j] - b[k]) * (O - b[k]) > 0 && (O - b[k]) * (r[i] - b[k]) > 0)
          f[i][j]++;
        if ((r[j] - b[k]) * (r[i] - b[k]) < 0 &&
            (r[i] - b[k]) * (O - b[k]) < 0 && (O - b[k]) * (r[j] - b[k]) < 0)
          f[i][j]++;
        if ((r[i] - b[k]) * (r[j] - b[k]) < 0 &&
            (r[j] - b[k]) * (O - b[k]) < 0 && (O - b[k]) * (r[i] - b[k]) < 0)
          f[i][j]++;
        if ((r[j] - b[k]) * (r[i] - b[k]) > 0 &&
            (r[i] - b[k]) * (O - b[k]) > 0 && (O - b[k]) * (r[j] - b[k]) > 0)
          f[i][j]++;
      }
    }
  }
  int ans = 0;
  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][k] == f[i][j] + f[j][k]) ans++;
      }
    }
  }
  cout << ans;
}
