#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 510;
int n, m;
int num[MAX_N][MAX_N];
long long area[MAX_N][MAX_N];
struct Point {
  int x, y;
  Point() {}
  Point(int _x, int _y) : x(_x), y(_y) {}
  void input() { scanf("%d%d", &x, &y); }
  bool operator<(const Point& rhs) const {
    if (y != rhs.y) return y < rhs.y;
    return x < rhs.x;
  }
  Point operator-(const Point& rhs) const {
    return Point(x - rhs.x, y - rhs.y);
  }
  long long cross(const Point& rhs) const {
    return 1ll * x * rhs.y - 1ll * y * rhs.x;
  }
} P[MAX_N], Q[MAX_N];
int In(Point a, Point b, Point c, Point d) {
  return (b - a).cross(d - a) > 0 && (c - b).cross(d - b) > 0 &&
         (a - c).cross(d - c) > 0;
}
void solve() {
  sort(P, P + n);
  Point ori = P[0];
  memset(num, 0, sizeof(num));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if ((P[i] - ori).cross(P[j] - ori) <= 0) continue;
      for (int k = 0; k < m; ++k) {
        if (In(ori, P[i], P[j], Q[k])) num[i][j]++;
      }
      num[j][i] = -num[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 (num[i][j] + num[j][k] + num[k][i] == 0) ans++;
      }
    }
  }
  printf("%d\n", ans);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) P[i].input();
  for (int i = 0; i < m; ++i) Q[i].input();
  solve();
  return 0;
}
