#include <bits/stdc++.h>
using namespace std;
int ctx, cty;
struct Point {
  int x, y, color;
  Point operator-(const Point& p) const {
    Point ans;
    ans.x = x - p.x, ans.y = y - p.y;
    ans.color = color;
    return ans;
  }
  bool operator<(const Point& b) const {
    if (y <= 0 && b.y <= 0 || y > 0 && b.y > 0)
      return 1ll * x * b.y > 1ll * y * b.x;
    return y < b.y;
  }
} p[550 << 1], pt[550 << 1], ct;
int n, m;
int xx[550 << 1];
long long xmult(Point p1, Point p2, Point p0) {
  return 1ll * (p1.x - p0.x) * (p2.y - p0.y) -
         1ll * (p1.y - p0.y) * (p2.x - p0.x);
}
bool side(Point p0, Point p1, Point p2) { return xmult(p0, p1, p2) < 0; }
bool in(Point p0, Point p1, Point p2, Point p3) {
  bool tmp = side(p0, p1, p2);
  return tmp == side(p0, p2, p3) && tmp == side(p0, p3, p1);
}
int sol(int n) {
  sort(p, p + n);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (p[i].color == 2) continue;
    Point blue;
    blue.color = -1;
    int j = i + 1;
    if (j >= n) j = 0;
    while (true) {
      if (xmult(p[i], p[j], ct) <= 0) break;
      if (p[j].color == 2) {
        if (blue.color == -1 || side(blue, p[j], p[i]) != side(ct, p[j], p[i]))
          blue = p[j];
      } else {
        if (blue.color == -1 || !in(blue, ct, p[i], p[j])) ans++;
      }
      j++;
      if (j >= n) j = 0;
    }
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &pt[i].x, &pt[i].y);
    pt[i].color = 1;
  }
  for (int i = n + 1; i <= n + m; i++) {
    scanf("%d%d", &pt[i].x, &pt[i].y);
    pt[i].color = 2;
  }
  int ans = 0;
  for (int i = 1; i + 2 <= n; i++) {
    int cnt = 0;
    for (int j = i + 1; j <= n + m; j++) p[cnt++] = pt[j] - pt[i];
    ans += sol(cnt);
  }
  printf("%d\n", ans);
  return 0;
}
