#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
void __never(int a) { printf("\nOPS %d", a); }
int Rx[512], Ry[512], Bx[512], By[512];
int n, m;
short cnt[512][512];
double eps = 0.000000000001;
inline bool in(int a, int b, int c, int d) {
  int mnx = min(Rx[a], min(Rx[b], Rx[c]));
  int mxx = max(Rx[a], max(Rx[b], Rx[c]));
  if (Bx[d] < mnx || Bx[d] > mxx) return false;
  int mny = min(Ry[a], min(Ry[b], Ry[c]));
  int mxy = max(Ry[a], max(Ry[b], Ry[c]));
  if (By[d] < mny || By[d] > mxy) return false;
  int dx1 = (Rx[a] - Bx[d]);
  int dy1 = (Ry[a] - By[d]);
  int dx2 = (Rx[b] - Bx[d]);
  int dy2 = (Ry[b] - By[d]);
  int dx3 = (Rx[c] - Bx[d]);
  int dy3 = (Ry[c] - By[d]);
  if (abs(dx1) < 10000 && abs(dx2) < 10000 && abs(dx3) < 10000 &&
      abs(dy1) < 10000 && abs(dy2) < 10000 && abs(dy3) < 10000) {
    int s1 = dx1 * dy2 - dx2 * dy1;
    int s2 = dx2 * dy3 - dx3 * dy2;
    int s3 = dx3 * dy1 - dx1 * dy3;
    return (s1 > 0 && s2 > 0 && s3 > 0 || s1 < 0 && s2 < 0 && s3 < 0);
  }
  bool s1 = ((double)dx1 * (double)dy2 < (double)dx2 * (double)dy1);
  bool s2 = ((double)dx2 * (double)dy3 < (double)dx3 * (double)dy2);
  bool s3 = ((double)dx3 * (double)dy1 < (double)dx1 * (double)dy3);
  return (s1 && s2 && s3 || !s1 && !s2 && !s3);
}
void sol() {
  for (int a = (2); a <= (n); a++)
    for (int b = (a + 1); b <= (n); b++) {
      bool flag = ((long long)(Rx[a] - Rx[1]) * (long long)(Ry[b] - Ry[1]) -
                       (long long)(Ry[a] - Ry[1]) * (long long)(Rx[b] - Rx[1]) >
                   0);
      for (int c = (1); c <= (m); c++)
        if (in(1, a, b, c)) {
          if (flag)
            cnt[a][b]++;
          else
            cnt[a][b]--;
        }
      cnt[b][a] = -cnt[a][b];
    }
  int ans = 0;
  for (int a = (1); a <= (n); a++)
    for (int b = (a + 1); b <= (n); b++)
      for (int c = (b + 1); c <= (n); c++)
        if (cnt[a][b] + cnt[b][c] + cnt[c][a] == 0) ans++;
  cout << ans;
}
int main() {
  int x, y;
  scanf("%d%d", &n, &m);
  for (int a = (1); a <= (n); a++) scanf("%d%d", &Rx[a], &Ry[a]);
  for (int b = (1); b <= (m); b++) scanf("%d%d", &Bx[b], &By[b]);
  sol();
  return 0;
}
