#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 9;
const int Mod = 1e9 + 7;
inline int dcmp(double x) {
  if (fabs(x) <= 1e-9) return 0;
  return x < 0 ? -1 : 1;
}
inline int scan() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline long long scan(long long x) {
  int f = 1;
  char ch = getchar();
  x = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
struct Point {
  int x, y;
  Point(int x = 0, int y = 0) : x(x), y(y) {}
  Point operator-(const Point &a) const { return Point(x - a.x, y - a.y); }
  Point operator*(const long long &a) const { return Point(x * a, y * a); }
  Point operator+(const Point &a) const { return Point(x + a.x, y + a.y); }
  bool operator==(const Point &a) const {
    return dcmp(x - a.x) == 0 && dcmp(y - a.y) == 0;
  }
  bool operator<(const Point &a) const {
    if (x == a.x) return y < a.y;
    return x < a.x;
  }
  void read() { scanf("%d%d", &x, &y); }
  void out() { cout << x << " " << y << endl; }
};
double Dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
double dis(Point a) { return sqrt(Dot(a, a)); }
long long Cross(Point a, Point b) { return a.x * 1LL * b.y - a.y * 1LL * b.x; }
bool chk(Point p1, Point p2, Point p3, Point p) {
  return abs(Cross(p2 - p, p1 - p)) + abs(Cross(p3 - p, p2 - p)) +
             abs(Cross(p1 - p, p3 - p)) ==
         abs(Cross(p2 - p1, p3 - p1));
}
int n, m;
Point p[5005], q[5005];
int mp[505][505];
void solve() {
  n = scan();
  m = scan();
  memset(mp, 0, sizeof(mp));
  for (int i = 0; i <= n - 1; i++) p[i].read();
  for (int i = 1; i <= m; i++) q[i].read();
  sort(p, p + n);
  for (int i = 0; i <= n - 1; i++) {
    for (int j = i + 1; j <= n - 1; j++) {
      for (int k = 1; k <= m; k++) {
        if (q[k].x > p[i].x && q[k].x <= p[j].x &&
            Cross(q[k] - p[j], p[i] - p[j]) < 0)
          mp[i][j]++;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= n - 1; i++) {
    for (int j = i + 1; j <= n - 1; j++) {
      for (int k = j + 1; k <= n - 1; k++) {
        int c1 = mp[i][j], c2 = mp[j][k], c3 = mp[i][k];
        if (c1 + c2 == c3) ans++;
      }
    }
  }
  cout << ans << endl;
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
