#include <bits/stdc++.h>
using namespace std;
struct pkt {
  int x, y;
  int nr;
};
long long Wek(pkt a, pkt b, pkt c) {
  long long w1x = (long long)b.x - (long long)a.x,
            w2x = (long long)c.x - (long long)b.x;
  long long w1y = (long long)b.y - (long long)a.y,
            w2y = (long long)c.y - (long long)b.y;
  return w1x * w2y - w2x * w1y;
}
bool Spr(vector<vector<int> >& il, pkt a, pkt b, pkt c) {
  if (b.x < a.x) swap(a, b);
  if (c.x < a.x) swap(a, c);
  if (c.x < b.x) swap(b, c);
  if (a.x != b.x && b.x != c.x && a.x != c.x) {
    if (Wek(a, b, c) < 0) {
      if (il[a.nr][c.nr] - il[a.nr][b.nr] - il[b.nr][c.nr] == 0) return true;
      return false;
    } else {
      if (il[a.nr][b.nr] + il[b.nr][c.nr] - il[a.nr][c.nr] == 0) return true;
      return false;
    }
  } else {
    if (a.x == b.x) {
      if (b.y > a.y) swap(a, b);
      if (il[a.nr][c.nr] - il[b.nr][c.nr] == 0) return true;
      return false;
    } else {
      if (b.y < c.y) swap(b, c);
      if (il[a.nr][b.nr] - il[a.nr][c.nr] == 0) return true;
      return false;
    }
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<pkt> a(n), b(m);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &a[i].x, &a[i].y);
    a[i].nr = i;
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d %d", &b[i].x, &b[i].y);
    b[i].nr = i;
  }
  vector<vector<int> > il(n, vector<int>(n, 0));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i != j && a[i].x < a[j].x) {
        for (int k = 0; k < m; ++k)
          if (b[k].x >= a[i].x && b[k].x < a[j].x)
            if (Wek(a[i], a[j], b[k]) < 0) ++il[i][j];
      }
    }
  }
  int odp = 0;
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j)
      for (int k = j + 1; k < n; ++k)
        if (Spr(il, a[i], a[j], a[k])) ++odp;
  printf("%d", odp);
  return 0;
}
