#include <bits/stdc++.h>
using namespace std;
int ctx, cty;
struct Point {
  int x, y, color, xx;
  void cal() {
    int tmpx = x - ctx, tmpy = y - cty;
    if (tmpx == 0 && tmpy == 0)
      xx = 0;
    else if (tmpx <= 0 && tmpy < 0)
      xx = 0;
    else if (tmpx > 0 && tmpy <= 0)
      xx = 1;
    else if (tmpx >= 0 && tmpy > 0)
      xx = 2;
    else
      xx = 3;
  }
} p[550 << 1], pt[550 << 1], ct;
int n, m;
int xx[550 << 1];
long long xmult(Point p1, Point p2, Point p0) {
  return 1ll * (p1.x - p0.x) * (p2.y - p0.y) -
         1ll * (p1.y - p0.y) * (p2.x - p0.x);
}
bool cmp(const int i, const int j) {
  if (p[i].xx != p[j].xx) return p[i].xx < p[j].xx;
  return xmult(p[i], p[j], ct) > 0;
}
bool side(Point p0, Point p1, Point p2) { return xmult(p0, p1, p2) < 0; }
bool in(Point p0, Point p1, Point p2, Point p3) {
  bool tmp = side(p0, p1, p2);
  return tmp == side(p0, p2, p3) && tmp == side(p0, p3, p1);
}
int r[550 << 1];
int sol(int n) {
  ctx = ct.x, cty = ct.y;
  for (int i = 0; i < n; i++) r[i] = i, p[i].cal();
  sort(r, r + n, cmp);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (p[r[i]].color == 2) continue;
    Point blue;
    blue.color = -1;
    int j = i + 1;
    if (j >= n) j = 0;
    while (true) {
      if (xmult(p[r[i]], p[r[j]], ct) <= 0) break;
      if (p[r[j]].color == 2) {
        if (blue.color == -1 ||
            side(blue, p[r[j]], p[r[i]]) != side(ct, p[r[j]], p[r[i]]))
          blue = p[r[j]];
      } else {
        if (blue.color == -1 || !in(blue, ct, p[r[i]], p[r[j]])) ans++;
      }
      j++;
      if (j >= n) j = 0;
    }
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &pt[i].x, &pt[i].y);
    pt[i].color = 1;
  }
  for (int i = n + 1; i <= n + m; i++) {
    scanf("%d%d", &pt[i].x, &pt[i].y);
    pt[i].color = 2;
  }
  int ans = 0;
  for (int i = 1; i + 2 <= n; i++) {
    int cnt = 0;
    for (int j = i + 1; j <= n + m; j++) p[cnt++] = pt[j];
    ct = pt[i];
    ans += sol(cnt);
  }
  printf("%d\n", ans);
  return 0;
}
