#include <bits/stdc++.h>
using namespace std;
struct P {
  long long x, y;
  P(){};
  P(long long x, long long y) : x(x), y(y){};
  P operator-(const P& b) const {
    P tmp(x - b.x, y - b.y);
    return tmp;
  }
  bool operator<(const P& b) const {
    if (x == b.x) return y < b.y;
    return x < b.x;
  }
};
long long cross(P a, P b) { return a.x * b.y - a.y * b.x; }
P red[505], blue[505];
int cnt[505][505];
int main() {
  int i, j, k;
  int N, M;
  long long x, y;
  memset(cnt, 0, sizeof(cnt));
  cin >> N >> M;
  for (i = 0; i < N; i++) {
    scanf("%I64d%I64d", &x, &y);
    red[i] = P(x, y);
  }
  for (i = 0; i < M; i++) {
    scanf("%I64d%I64d", &x, &y);
    blue[i] = P(x, y);
  }
  sort(red, red + N);
  for (i = 0; i < N; i++) {
    for (j = i + 1; j < N; j++) {
      for (k = 0; k < M; k++) {
        if (blue[k].x >= red[i].x && blue[k].x < red[j].x &&
            cross(blue[k] - red[i], red[j] - red[i]) > 0)
          cnt[i][j]++;
      }
      cnt[j][i] = -cnt[i][j];
    }
  }
  int ans = 0;
  for (i = 0; i < N; i++) {
    for (j = i + 1; j < N; j++)
      for (k = j + 1; k < N; k++) {
        if (cnt[i][j] + cnt[j][k] + cnt[k][i] == 0) ans++;
      }
  }
  cout << ans << endl;
  return 0;
}
