#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:836777216")
using namespace std;
int n, m;
int x[555], X[555], y[555], Y[555];
vector<pair<double, int> > v;
long long sq(long long x1, long long y1, long long x2, long long y2,
             long long x3, long long y3) {
  return (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);
}
int main() {
  cin >> n >> m;
  for (int i(0); i < (n); i++) cin >> x[i] >> y[i];
  for (int i(0); i < (m); i++) cin >> X[i] >> Y[i];
  int res = 0;
  for (int i(0); i < (n); i++) {
    v.clear();
    for (int j(0); j < (n); j++)
      if (i != j && (y[j] > y[i] || y[j] == y[i] && x[j] >= x[i]))
        v.push_back(
            pair<double, int>(atan2(y[j] - y[i] + 0., x[j] - x[i]), j + 1));
    for (int j(0); j < (m); j++)
      if ((Y[j] > y[i] || Y[j] == y[i] && X[j] >= x[i]))
        v.push_back(
            pair<double, int>(atan2(Y[j] - y[i] + 0., X[j] - x[i]), -j - 1));
    sort((v).begin(), (v).end());
    for (int j(0); j < (v.size()); j++)
      if (v[j].second > 0) {
        int beg = v[j].second - 1;
        int pos = -1;
        for (int k(j + 1); k < (v.size()); k++) {
          if (v[k].second > 0) {
            int curr = v[k].second - 1;
            if (pos == -1 ||
                sq(x[beg], y[beg], X[pos], Y[pos], x[curr], y[curr]) > 0)
              res++;
          } else {
            int curr = -v[k].second - 1;
            if (pos == -1 ||
                sq(x[beg], y[beg], X[pos], Y[pos], X[curr], Y[curr]) > 0)
              pos = curr;
          }
        }
      }
  }
  cout << res << endl;
  return 0;
}
