#include <bits/stdc++.h>
using namespace std;
struct aaa {
  long long x, y;
} a[1001], b[1001];
long long n, m, ans, f[502][502];
aaa operator-(aaa a, aaa b) { return aaa{a.x - b.x, a.y - b.y}; }
bool cmp(aaa a, aaa b) { return a.x < b.x || a.x == b.x && a.y < b.y; }
long long pd(aaa a, aaa b) { return a.x * b.y - a.y * b.x; }
int main() {
  long long i, j, k;
  scanf("%lld%lld", &n, &m);
  for (i = 1; i <= n; i++) scanf("%lld%lld", &a[i].x, &a[i].y);
  for (i = 1; i <= m; i++) scanf("%lld%lld", &b[i].x, &b[i].y);
  sort(a + 1, a + n + 1, cmp);
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) {
      if (a[i].x == a[j].x) continue;
      for (k = 1; k <= m; k++)
        if (b[k].x > a[i].x && b[k].x <= a[j].x &&
            pd(b[k] - a[i], a[j] - a[i]) > 0)
          f[i][j]++;
    }
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++)
      for (k = j + 1; k <= n; k++)
        if (f[i][j] + f[j][k] == f[i][k]) {
          ans++;
        }
  printf("%lld", ans);
}
