#include <bits/stdc++.h>
using namespace std;
const int MaxN = 505;
const int MaxM = 505;
const int MaxP = (MaxN + MaxM) << 1;
const double pi = acos(-1.0);
const double eps = 1e-8;
int sgn(double x) { return x < -eps ? -1 : x > eps; }
struct pt {
  double x, y;
  int id;
  pt() {}
  pt(double x, double y) : x(x), y(y) {}
  pt operator+(const pt& p) const { return pt(x + p.x, y + p.y); }
  pt operator-(const pt& p) const { return pt(x - p.x, y - p.y); }
  double operator*(const pt& p) const { return x * p.y - y * p.x; }
  pair<double, int> to_pt(const pt& p) const {
    return make_pair(atan2(y - p.y, x - p.x), id);
  }
  void init(int _id) {
    id = _id;
    scanf("%lf%lf", &x, &y);
  }
} red[MaxN], black[MaxM];
int n, m, pn;
int dp[MaxN][MaxN], idx1[MaxN][MaxN], idx2[MaxN][MaxN];
pair<double, int> p[MaxP];
int xmult(const pt& p1, const pt& p2, const pt& p) {
  return sgn((p1 - p) * (p2 - p));
}
void doit() {
  int cnt, cot;
  for (int i = 0; i < n; i++) {
    pn = 0;
    for (int j = 0; j < n; j++)
      if (i != j) p[pn++] = red[j].to_pt(red[i]);
    for (int j = 0; j < m; j++) p[pn++] = black[j].to_pt(red[i]);
    sort(p, p + pn);
    for (int j = 0; j < pn; j++) {
      p[pn + j] = p[j];
      p[pn + j].first += 2 * pi;
    }
    cnt = cot = 0;
    for (int j = 0, k = 0; j < pn; j++) {
      while (p[k].first - p[j].first < pi - eps)
        if (p[k++].second >= n) cnt++;
      if (p[j].second < n) {
        idx1[i][p[j].second] = cot;
        idx2[i][p[j].second] = j;
        dp[i][p[j].second] = m - (p[j].second >= n) - cnt;
      } else {
        cot++;
        cnt--;
      }
    }
  }
}
int g(int a, int b, int c) {
  if (idx2[a][c] >= idx2[a][b])
    return idx1[a][c] - idx1[a][b];
  else
    return m - (idx1[a][b] - idx1[a][c]);
}
bool doit(int a, int b, int c) {
  int ret = 0;
  if (xmult(red[b], red[c], red[a]) < 0) swap(b, c);
  ret += dp[a][b];
  ret += dp[b][c];
  ret += dp[c][a];
  ret += g(a, b, c);
  ret += g(b, c, a);
  ret += g(c, a, b);
  ret -= 2 * m;
  return ret == 0;
}
int main() {
  int ret;
  while (scanf("%d%d", &n, &m) == 2) {
    for (int i = 0; i < n; i++) red[i].init(i);
    for (int i = 0; i < m; i++) black[i].init(i + n);
    doit();
    ret = 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 (doit(i, j, k)) ret++;
    printf("%d\n", ret);
  }
  return 0;
}
