#include <bits/stdc++.h>
using namespace std;
struct Point {
  long long x, y;
  int kind;
  int id;
  Point() {}
  Point(long long _x, long long _y) {
    x = _x;
    y = _y;
  }
  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }
  long long operator^(const Point &b) const { return x * b.y - y * b.x; }
  long long operator*(const Point &b) const { return x * b.x + y * b.y; }
  void transXY(long long B) {
    long long tx = x, ty = y;
    x = tx * cos(B) - ty * sin(B);
    y = tx * sin(B) + ty * cos(B);
  }
} p[1505], q[1505];
int r[505], tmp[505];
const long long eps = 1e-8;
const long long PI = acos(-1.0);
bool cmp(Point a, Point b) {
  if (a.y == b.y) return a.x < b.x;
  return a.y < b.y;
}
int sgn(long long x) {
  if (x == 0) return 0;
  if (x < 0)
    return -1;
  else
    return 1;
}
long long dist(Point a, Point b) { return (a - b) * (a - b); }
int nowp;
bool _cmp(Point p1, Point p2) {
  long long temp = (p1 - p[nowp]) ^ (p2 - p[nowp]);
  if (sgn(temp) > 0)
    return true;
  else if (sgn(temp) == 0 && sgn(dist(p1, p[nowp]) - dist(p2, p[nowp])) <= 0)
    return true;
  else
    return false;
}
int ans = 0;
int n, m;
void solve(int k, int len) {
  for (int i = k + 1; i < len; i++) {
    if (q[i].kind == 2) continue;
    int la = k;
    for (int j = i + 1; j < len; j++) {
      long long temp = (q[j] - q[i]) ^ (q[la] - q[i]);
      if (q[j].kind == 1) {
        if (temp < 0 || la == k) {
          ans++;
        }
      } else {
        if (temp < 0 || la == k) {
          la = j;
        }
      }
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  int len = n + m;
  for (int i = 0; i < n + m; i++) {
    scanf("%I64d%I64d", &p[i].x, &p[i].y);
    p[i].id = i;
    if (i < n)
      p[i].kind = 1;
    else
      p[i].kind = 2;
  }
  sort(p, p + len, cmp);
  int len1 = 0;
  for (int i = 0; i < len; i++) {
    if (p[i].kind == 2) continue;
    nowp = i;
    for (int j = nowp; j < len; j++) q[j] = p[j];
    sort(q + nowp, q + len, _cmp);
    solve(nowp, len);
  }
  printf("%d\n", ans);
  return 0;
}
