#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500;
int n, m;
int blue[MAXN][MAXN][531 / 32];
pair<int, int> rp[MAXN], bp[MAXN];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &rp[i].first, &rp[i].second);
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &bp[i].first, &bp[i].second);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      long long A = rp[i].second - rp[j].second;
      long long B = rp[j].first - rp[i].first;
      long long C = -A * rp[i].first - B * rp[i].second;
      for (int k = 0; k < m; ++k) {
        long long val = A * bp[k].first + B * bp[k].second + C;
        if (val > 0)
          blue[i][j][k >> 5] |= 1 << (k & 0x1f);
        else
          blue[j][i][k >> 5] |= 1 << (k & 0x1f);
      }
    }
  }
  int res = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      long long A = rp[i].second - rp[j].second;
      long long B = rp[j].first - rp[i].first;
      long long C = -A * rp[i].first - B * rp[i].second;
      for (int k = j + 1; k < n; ++k) {
        bool add = true;
        if (A * rp[k].first + B * rp[k].second > -C) {
          for (int l = 0; l < 531 / 32; ++l) {
            if (blue[i][j][l] & blue[j][k][l] & blue[k][i][l]) {
              add = false;
              break;
            }
          }
        } else {
          for (int l = 0; l < 531 / 32; ++l) {
            if (blue[k][j][l] & blue[j][i][l] & blue[i][k][l]) {
              add = false;
              break;
            }
          }
        }
        res += add;
      }
    }
  }
  printf("%d\n", res);
  return 0;
}
