#include <bits/stdc++.h>
using namespace std;
const int N = 500;
int rx[N], ry[N];
int bx[N], by[N];
int bal[N][N];
long long rbx[N][N];
long long rby[N][N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = (0); i < (int)(n); ++i) cin >> rx[i] >> ry[i];
  for (int i = (0); i < (int)(m); ++i) cin >> bx[i] >> by[i];
  for (int i = (0); i < (int)(n); ++i)
    for (int j = (0); j < (int)(m); ++j) {
      rbx[i][j] = rx[i] - bx[j];
      rby[i][j] = ry[i] - by[j];
    }
  for (int i = (0); i < (int)(n); ++i)
    for (int j = (0); j < (int)(n); ++j) {
      int x1 = min(rx[i], rx[j]);
      int x2 = max(rx[i], rx[j]);
      for (int k = (0); k < (int)(m); ++k)
        if (x1 <= bx[k] && bx[k] < x2) {
          bal[i][j] += rbx[j][k] * rby[i][k] > rby[j][k] * rbx[i][k] ? 1 : -1;
        }
    }
  int res = 0;
  for (int i = (0); i < (int)(n); ++i)
    for (int j = (i + 1); j < (int)(n); ++j)
      for (int k = (j + 1); k < (int)(n); ++k)
        res += bal[i][j] + bal[j][k] + bal[k][i] == 0;
  cout << res << endl;
  return 0;
}
