#include <bits/stdc++.h>
using namespace std;
struct Point {
  long long first, second;
  int color;
  Point() {
    first = 0;
    second = 0;
    color = -1;
  }
  Point(long long ix, long long iy, int icolor) {
    first = ix;
    second = iy;
    color = icolor;
  }
  bool operator==(Point p) {
    return first == p.first && second == p.second && color == p.color;
  }
};
bool by_first(const pair<double, Point>& a, const pair<double, Point>& b) {
  return a.first < b.first;
}
long long cross_product_z(pair<long long, long long> u,
                          pair<long long, long long> v) {
  return u.first * v.second - v.first * u.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<Point> r(n);
  for (int i = 0; i < n; ++i) cin >> r[i].first >> r[i].second;
  vector<Point> b(m);
  for (int i = 0; i < m; ++i) cin >> b[i].first >> b[i].second;
  int ans = 0;
  for (int ir = n - 1; ir >= 0; --ir, r.pop_back()) {
    vector<pair<double, Point> > atan2_rb;
    for (int i = 0; i < int(r.size()) - 1; ++i) {
      Point p =
          Point(r[i].first - r.back().first, r[i].second - r.back().second, 0);
      atan2_rb.push_back(make_pair(atan2(p.second, p.first), p));
    }
    for (int i = 0; i < m; ++i) {
      Point p =
          Point(b[i].first - r.back().first, b[i].second - r.back().second, 1);
      atan2_rb.push_back(make_pair(atan2(p.second, p.first), p));
    }
    sort(atan2_rb.begin(), atan2_rb.end(), by_first);
    vector<Point> rb;
    for (int i = 0; i < int(atan2_rb.size()); ++i) {
      rb.push_back(atan2_rb[i].second);
    }
    for (int i = 0; i < int(rb.size()); ++i) {
      if (rb[i].color == 1) continue;
      const pair<long long, long long> u =
          pair<long long, long long>(rb[i].first, rb[i].second);
      pair<long long, long long> lim = u;
      for (int j = (i + 1) % int(rb.size()); j != i;) {
        pair<long long, long long> v = pair<long long, long long>(
            rb[j].first - rb[i].first, rb[j].second - rb[i].second);
        if (cross_product_z(lim, v) > 0) {
          if (cross_product_z(u, v) < 0) break;
          if (rb[j].color == 0)
            ++ans;
          else
            lim = v;
        }
        ++j;
        if (j == int(rb.size())) j = 0;
      }
    }
  }
  cout << ans << endl;
}
