#include <bits/stdc++.h>
using namespace std;
struct pt {
  long long x, y;
  bool operator<(const pt& other) const { return x < other.x; }
};
int n, m;
pt red[512], blue[512];
int down[512], down2[512][512];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%I64d%I64d", &red[i].x, &red[i].y);
  for (int i = 0; i < m; i++) scanf("%I64d%I64d", &blue[i].x, &blue[i].y);
  sort(red, red + n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (red[i].x == blue[j].x && red[i].y > blue[j].y) down[i]++;
    }
    for (int j = i + 1; j < n; j++) {
      long long vx = red[j].x - red[i].x;
      long long vy = red[j].y - red[i].y;
      for (int h = 0; h < m; h++) {
        if (red[i].x < blue[h].x && blue[h].x < red[j].x &&
            (blue[h].x - red[i].x) * vy - (blue[h].y - red[i].y) * vx > 0) {
          down2[i][j]++;
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int h = j + 1; h < n; h++) {
        int d1 = down[j] + down2[i][j] + down2[j][h];
        int d2 = down2[i][h];
        ans += (d1 == d2);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
