#include <bits/stdc++.h>
using namespace std;
const int N = 10000;
long long l[600][600];
int s, m, n, ans;
struct p {
  long long x, y;
} r[N], b[N];
bool cmp(p A, p B) { return A.x < B.x; }
long long gc(long long x1, long long y1, long long x2, long long y2) {
  return x1 * y2 - x2 * y1;
}
int gt(long long x1, long long y1, long long x2, long long y2) {
  int re = 0;
  if (x1 - x2 == 0) return 0;
  for (int i = 1; i <= n; i++) {
    if (b[i].x > x1 && b[i].x <= x2 &&
        gc(x2 - x1, y2 - y1, b[i].x - x1, b[i].y - y1) > 0)
      re++;
  }
  return re;
}
int main() {
  cin >> m >> n;
  for (int i = 1; i <= m; i++) cin >> r[i].x >> r[i].y;
  for (int i = 1; i <= n; i++) cin >> b[i].x >> b[i].y;
  sort(r + 1, r + 1 + m, cmp);
  sort(b + 1, b + 1 + n, cmp);
  for (int i = 1; i < m; i++) {
    for (int j = i + 1; j <= m; j++) {
      l[i][j] = gt(r[i].x, r[i].y, r[j].x, r[j].y);
    }
  }
  for (int i = 1; i < m - 1; i++)
    for (int j = i + 1; j < m; j++)
      for (int k = j + 1; k <= m; k++) {
        if (l[i][k] == l[i][j] + l[j][k]) ans++;
      }
  cout << ans << endl;
  return 0;
}
