#include <bits/stdc++.h>
using namespace std;
struct pnt {
  int x, y;
  pnt() {}
  pnt(int x_, int y_) : x(x_), y(y_) {}
  void read() { scanf("%d%d", &x, &y); }
};
pnt operator+(pnt a, pnt b) { return pnt(a.x + b.x, a.y + b.y); }
pnt operator-(pnt a, pnt b) { return pnt(a.x - b.x, a.y - b.y); }
pnt operator*(pnt a, int k) { return pnt(a.x * k, a.y * k); }
long double operator*(pnt a, pnt b) {
  return (long double)a.x * b.y - (long double)a.y * b.x;
}
bool operator==(pnt a, pnt b) { return a.x == b.x && a.y == b.y; }
const int maxn = 512;
int n, m;
pnt p[maxn], q[maxn];
unsigned long long is[maxn][maxn][maxn / 64];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (int)(n); i++) p[i].read();
  random_shuffle(p, p + n);
  for (int i = 0; i < (int)(m); i++) q[i].read();
  random_shuffle(q, q + m);
  for (int i = 0; i < (int)(n); i++) {
    pnt st = p[i];
    for (int j = 0; j < (int)(n); j++) p[j] = p[j] - st;
    for (int j = 0; j < (int)(m); j++) q[j] = q[j] - st;
    for (int j = 0; j < (int)(i); j++)
      for (int k = 0; k < (int)(m); k++)
        if (q[k] * p[j] > 0) is[i][j][k >> 6] |= 1ULL << (k & 63);
    for (int j = 0; j < (int)(n); j++) p[j] = p[j] + st;
    for (int j = 0; j < (int)(m); j++) q[j] = q[j] + st;
  }
  int cnt = 0;
  for (int i = 0; i < (int)(n); i++) {
    pnt st = p[i];
    for (int j = 0; j < (int)(n); j++) p[j] = p[j] - st;
    for (int j = 0; j < (int)(i); j++)
      for (int k = 0; k < (int)(j); k++) {
        int x = p[k] * p[j] > 0;
        unsigned long long *is1 = is[i][j];
        unsigned long long *is2 = is[i][k];
        unsigned long long *is3 = is[j][k];
        int good = 1, num = m;
        while (1) {
          unsigned long long f;
          if (x)
            f = *is1++ & ~*is2++ & *is3++;
          else
            f = ~*is1++ & *is2++ & ~*is3++;
          if (num <= 64) {
            f &= ((unsigned long long)-1) >> (64 - num);
            if (f != 0) good = 0;
            break;
          }
          if (f != 0) {
            good = 0;
            break;
          }
          num -= 64;
        }
        cnt += good;
      }
    for (int j = 0; j < (int)(n); j++) p[j] = p[j] + st;
  }
  cout << cnt << endl;
  return 0;
}
