#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
struct Point {
  long long x, y;
  Point(long long x = 0, long long y = 0) : x(x), y(y) {}
};
int ccw(Point p0, Point p1, Point p2) {
  long long c = (p1.x - p0.x) * (p2.y - p0.y) - (p2.x - p0.x) * (p1.y - p0.y);
  if (c == 0) return 0;
  return (c > 0) ? 1 : -1;
}
Point A[700];
Point B[700];
int Num[700][700];
int main() {
  int n = 0;
  int m = 0;
  scanf("%d%d", &n, &m);
  for (int i = (0); i < (n); i++) {
    scanf("%I64d%I64d", &A[i].x, &A[i].y);
  }
  for (int i = (0); i < (m); i++) {
    scanf("%I64d%I64d", &B[i].x, &B[i].y);
  }
  int Ref = 0;
  for (int i = (0); i < (n); i++) {
    if (A[i].x < A[Ref].x || (A[i].x == A[Ref].x && A[i].y < A[Ref].y)) Ref = i;
  }
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (i); j++) {
      Num[i][j] = 0;
      if (i != Ref && j != Ref) {
        for (int k = (0); k < (m); k++) {
          int F = 1;
          if (ccw(A[Ref], A[i], A[j]) < 0) {
            F *= -1;
          }
          int CW = ccw(A[Ref], A[i], A[j]);
          if (ccw(A[Ref], A[i], B[k]) == CW && ccw(A[i], A[j], B[k]) == CW &&
              ccw(A[j], A[Ref], B[k]) == CW) {
            Num[i][j] += F;
          }
        }
      }
      Num[j][i] = -Num[i][j];
    }
  }
  int Res = 0;
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (i); j++) {
      for (int k = (0); k < (j); k++) {
        int Sum = Num[i][j] + Num[j][k] + Num[k][i];
        if (Sum == 0) {
          Res++;
        }
      }
    }
  }
  printf("%d\n", Res);
  return 0;
}
