#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  Point() { x = y = 0; }
  Point(int _x, int _y) {
    x = _x;
    y = _y;
  }
  Point operator-(const Point &a) const { return (Point(x - a.x, y - a.y)); }
  long long operator%(const Point &a) const {
    return (1LL * x * a.y - 1LL * a.x * y);
  }
  int area(void) const {
    if (x > 0 && y == 0) return (0);
    if (x > 0 && y > 0) return (1);
    if (x == 0 && y > 0) return (2);
    if (x < 0 && y > 0) return (3);
    if (x < 0 && y == 0) return (4);
    if (x < 0 && y < 0) return (5);
    if (x == 0 && y < 0) return (6);
    if (x > 0 && y < 0) return (7);
  }
  bool operator<(const Point &p) const {
    int a = area();
    int pa = p.area();
    if (a != pa) return (a < pa);
    long long tmp = *this % p;
    if (tmp != 0) return (tmp > 0);
    return (y < p.y);
  }
};
istream &operator>>(istream &is, Point &p) { return (is >> p.x >> p.y); }
Point red[1010], blue[1010];
pair<Point, int> cur[1010];
int nRed, nBlue, res;
void init(void) {
  cin >> nRed >> nBlue;
  for (int i = (1), _b = (nRed); i <= _b; i = i + 1) cin >> red[i];
  for (int i = (1), _b = (nBlue); i <= _b; i = i + 1) cin >> blue[i];
}
bool betweenRay(const Point &a, const Point &b, const Point &c) {
  long long dirA = b % a;
  long long dirC = b % c;
  if (dirA < 0 && dirC > 0) return (true);
  if (dirA > 0 && dirC < 0) return (true);
  return (false);
}
void countTriangle(int id) {
  Point A = red[id];
  int n = 0;
  for (int i = (id + 1), _b = (nRed); i <= _b; i = i + 1)
    cur[n++] = make_pair(red[i] - A, i);
  for (int i = (1), _b = (nBlue); i <= _b; i = i + 1)
    cur[n++] = make_pair(blue[i] - A, -i);
  sort(cur, cur + n);
  for (int i = 0, _n = (n); i < _n; i = i + 1)
    if (cur[i].second > 0) {
      Point B = cur[i].first;
      Point *D = NULL;
      Point lim = Point() - B;
      int j = (i + 1) % n;
      for (int love = 0, _n = (n); love < _n; love = love + 1) {
        if (lim % cur[j].first >= 0) break;
        Point C = cur[j].first;
        if (cur[j].second > 0) {
          if (D == NULL || !betweenRay(Point() - B, *D - B, C - B)) {
            res++;
          }
        } else {
          if (D == NULL)
            D = new Point(C);
          else if (betweenRay(Point() - B, C - B, *D - B))
            *D = C;
        }
        j = (j + 1) % n;
      }
    }
}
void process(void) {
  for (int i = (1), _b = (nRed - 2); i <= _b; i = i + 1) countTriangle(i);
  cout << res << endl;
}
int main(void) {
  init();
  process();
  return 0;
}
