#include <bits/stdc++.h>
using namespace std;
const int MAXN = 505;
pair<int, int> P[2 * MAXN];
int cnt[MAXN][MAXN];
int cntB[MAXN];
inline bool below(const pair<int, int> &A, const pair<int, int> &B,
                  const pair<int, int> &C) {
  return (1LL * (B.first - A.first) * (C.second - A.second) -
          1LL * (C.first - A.first) * (B.second - A.second)) < 0;
}
int main() {
  int N, M;
  int numP;
  scanf("%d %d", &N, &M);
  for (int i = 0; i < N; ++i) scanf("%d %d", &P[i].first, &P[i].second);
  sort(P, P + N);
  for (int i = N; i < N + M; ++i) scanf("%d %d", &P[i].first, &P[i].second);
  for (int i = 0; i < N - 1; ++i)
    for (int j = i + 1; j < N; ++j)
      for (int k = N; k < N + M; ++k)
        if (P[k].first >= P[i].first && P[k].first <= P[j].first &&
            below(P[i], P[j], P[k]))
          cnt[i][j]++;
  for (int i = 0; i < N; ++i)
    for (int j = N; j < N + M; ++j)
      if (P[i].first == P[j].first && P[j].second < P[i].second) cntB[i]++;
  int res = 0;
  for (int i = 0; i < N - 2; ++i)
    for (int j = i + 1; j < N - 1; ++j)
      for (int k = j + 1; k < N; ++k) {
        numP = cnt[i][j] + cnt[j][k] - cnt[i][k] - cntB[j];
        if (!numP) res++;
      }
  printf("%d\n", res);
  return 0;
}
