#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
} a[512], b[512];
bool cmp(point a, point b) { return a.x < b.x; }
int edge[512][512];
bool upon(point a, point b, point c) {
  if (a.x > b.x && a.x <= c.x) {
    double y = 1.0 * (b.y - c.y) / (b.x - c.x) * (a.x - b.x) + b.y;
    if (y < a.y) return true;
  }
  return false;
}
int n, m;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &a[i].x, &a[i].y);
  }
  sort(a, a + n, cmp);
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &b[i].x, &b[i].y);
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      edge[i][j] = 0;
      for (int k = 0; k < m; k++) {
        if (upon(b[k], a[i], a[j])) edge[i][j]++;
      }
    }
  }
  int ans = 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 (edge[i][j] + edge[j][k] != edge[i][k]) continue;
        ans++;
      }
    }
  }
  printf("%d\n", ans);
}
