#include <bits/stdc++.h>
const int INF = 2009000999;
const double cp = 3.14159265;
const double eps = 1e-9;
using namespace std;
struct pt {
  double x, y;
};
pt a[501], b[501];
bool operator<(const pt &a, const pt &b) {
  if (fabs(a.x - b.x) > eps) return a.x < b.x;
  return a.y < b.y;
}
int sum[5001][501], sumb[501];
inline double det(double x1, double y1, double x2, double y2) {
  return x1 * y2 - y1 * x2;
}
inline double cross(const pt &a, const pt &b, const pt &c) {
  return det(c.x - a.x, c.y - a.y, c.x - b.x, c.y - b.y);
}
int main() {
  long long n, m;
  cin >> n >> m;
  for (int(i) = 1; (i) <= (n); i++) cin >> a[i].x >> a[i].y;
  for (int(i) = 1; (i) <= (m); i++) cin >> b[i].x >> b[i].y;
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  for (int(i) = 1; (i) <= (n); i++)
    for (int(j) = 1; (j) <= (m); j++)
      if (fabs(a[i].x - b[j].x) <= eps && b[j].y >= a[i].y) sumb[i]++;
  for (int(i) = 1; (i) <= (n); i++)
    for (int j = i + 1; j <= n; j++)
      for (int(k) = 1; (k) <= (m); k++)
        if (b[k].x >= a[i].x && b[k].x <= a[j].x && cross(b[k], a[i], a[j]) > 0)
          sum[i][j]++;
  int ans = 0;
  for (int(i) = 1; (i) <= (n); i++)
    for (int j = i + 1; j <= n; j++)
      for (int k = j + 1; k <= n; k++) {
        if (fabs(a[i].x - a[j].x) <= eps) {
          int tmp = sum[i][k] - sum[j][k];
          if (tmp == 0) ans++;
        } else if (fabs(a[j].x - a[k].x) <= eps) {
          int tmp = sum[i][j] - sum[i][k];
          if (tmp == 0) ans++;
        } else {
          int tmp = sum[i][k] - sum[i][j] - sum[j][k] + sumb[j];
          if (tmp == 0) ans++;
        }
      }
  cout << ans << endl;
  return 0;
}
