#include <bits/stdc++.h>
using namespace std;
void prepare() {}
struct C {
  int x;
  int y;
  bool operator<(const C &b) const { return x < b.x || (x == b.x && y < b.y); }
};
const int MAXN = 505;
C a[MAXN];
C b[MAXN];
int d[MAXN][MAXN];
bool solve() {
  int i, n, m, k, j, res, jj;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) scanf("%d%d", &a[i].x, &a[i].y);
  for (i = 0; i < m; i++) scanf("%d%d", &b[i].x, &b[i].y);
  sort(a, a + n);
  sort(b, b + m);
  for (i = 0; i < n; i++) {
    jj = 0;
    for (k = i + 1; k < n; k++) {
      for (j = jj; j < m; j++) {
        if (b[j].x <= a[i].x) {
          jj = j + 1;
          continue;
        }
        if (a[k].x < b[j].x) break;
        if ((long long)(a[k].x - a[i].x) * (b[j].y - a[i].y) <
            (long long)(a[k].y - a[i].y) * (b[j].x - a[i].x))
          d[i][k]++;
      }
    }
  }
  res = 0;
  for (i = 0; i < n; i++) {
    for (k = i + 1; k < n; k++) {
      for (j = k + 1; j < n; j++) {
        if (d[i][k] + d[k][j] == d[i][j]) res++;
      }
    }
  }
  printf("%d\n", res);
  return true;
}
int main() {
  prepare();
  solve();
  return 0;
}
