#include <bits/stdc++.h>
using namespace std;
struct P {
  long long x, y;
  int c;
  P() {}
  P(long long x, long long y) : x(x), y(y) {}
  bool halfup() const { return y > 0 || (x > 0 && y == 0); }
};
P operator-(const P &lhs, const P &rhs) {
  return P(lhs.x - rhs.x, lhs.y - rhs.y);
}
long long ccw(const P &p1, const P &p2, const P &p3) {
  P pp2 = p2 - p1, pp3 = p3 - p1;
  return pp2.x * pp3.y - pp3.x * pp2.y;
}
long long cross(const P &p1, const P &p2) { return p1.x * p2.y - p2.x * p1.y; }
bool operator<(const P &lhs, const P &rhs) {
  if (lhs.halfup() ^ rhs.halfup()) {
    return lhs.halfup() < rhs.halfup();
  } else {
    return cross(lhs, rhs) > 0;
  }
}
P vpa[510], vpb[510];
P rots[1020];
int main() {
  int N, M;
  while (scanf("%d%d", &N, &M) != EOF) {
    for (int i = 0; i < (int)(N); ++i) {
      int x, y;
      scanf("%d%d", &x, &y);
      vpa[i] = P(x, y);
    }
    for (int i = 0; i < (int)(M); ++i) {
      int x, y;
      scanf("%d%d", &x, &y);
      vpb[i] = P(x, y);
    }
    int res = 0;
    for (int k = 0; k < (int)(N); ++k) {
      for (int i = 0; i < (int)(k); ++i) {
        rots[i] = vpa[i] - vpa[k];
        rots[i].c = 0;
      }
      for (int i = 0; i < (int)(M); ++i) {
        rots[i + k] = vpb[i] - vpa[k];
        rots[i + k].c = 1;
      }
      sort(rots, rots + M + k);
      for (int s = 0; s < (int)(k + M); ++s) {
        if (rots[s].c == 1) {
          continue;
        }
        int i = (s + 1) % (k + M);
        int border = -1;
        for (; i != s && cross(rots[s], rots[i]) > 0; i = (i + 1) % (k + M)) {
          bool inc = false;
          if (border >= 0 && ccw(rots[s], rots[border], rots[i]) < 0) {
            inc = true;
          }
          if (rots[i].c == 1) {
            if (!inc) border = i;
          } else {
            if (!inc) res++;
          }
        }
      }
    }
    printf("%d\n", res);
  }
}
