#include <bits/stdc++.h>
using namespace std;
const int lmax = 505;
struct point {
  int x, y;
} p[lmax];
bool cmp(point p1, point p2) {
  if (p1.x == p2.x) return p1.y < p2.y;
  return p1.x < p2.x;
}
int main() {
  int n, m, i, j, k, x, y, sum, num[lmax], count[lmax][lmax];
  while (scanf("%d%d", &n, &m) != EOF) {
    for (i = 0; i < n; i++) scanf("%d%d", &p[i].x, &p[i].y);
    sort(p, p + n, cmp);
    memset(num, 0, sizeof(num));
    memset(count, 0, sizeof(count));
    for (i = 0; i < m; i++) {
      scanf("%d%d", &x, &y);
      for (j = 0; j < n; j++)
        if (p[j].x == x && y < p[j].y) num[j]++;
      for (j = 0; j < n - 1; j++)
        for (k = j + 1; k < n; k++)
          if (p[j].x <= x && x <= p[k].x) {
            double slope = double(p[j].y - p[k].y) / double(p[j].x - p[k].x);
            if (y <= slope * (x - p[j].x) + p[j].y) count[j][k]++;
          }
    }
    for (sum = i = 0; i < n - 2; i++)
      for (j = i + 1; j < n - 1; j++)
        for (k = j + 1; k < n; k++)
          if (count[i][j] + count[j][k] - num[j] - count[i][k] == 0) sum++;
    printf("%d\n", sum);
  }
}
