#include <bits/stdc++.h>
using namespace std;
int n, m;
pair<long long int, long long int> red[505], blue[505];
int val[505][505];
long long int ccw(pair<long long int, long long int> a,
                  pair<long long int, long long int> b,
                  pair<long long int, long long int> c) {
  return (b.first - a.first) * (c.second - a.second) -
         (b.second - a.second) * (c.first - a.first);
}
int main() {
  cin >> n >> m;
  for (long long int i = 1; i <= n; i++) cin >> red[i].first >> red[i].second;
  for (long long int i = 1; i <= m; i++) cin >> blue[i].first >> blue[i].second;
  for (long long int i = 1; i <= n; i++)
    for (long long int j = 1; j <= n; j++) {
      if (i == j) continue;
      pair<long long int, long long int> a = red[i], b = red[j];
      if (a.second == b.second) continue;
      if (a.second > b.second) swap(a, b);
      for (long long int k = 1; k <= m; k++)
        if (a.second < blue[k].second and blue[k].second <= b.second and
            ccw(a, b, blue[k]) < 0)
          val[i][j]++;
      if (red[i].second < red[j].second) val[i][j] *= -1;
    }
  int res = 0;
  for (long long int i = 1; i <= n; i++)
    for (long long int j = i + 1; j <= n; j++)
      for (long long int k = j + 1; k <= n; k++)
        if (!(val[i][j] + val[j][k] + val[k][i])) res++;
  cout << res << endl;
}
