#include <bits/stdc++.h>
using namespace std;
const long long N = 500 + 6;
const long long base = 11;
const long long mod = 1e9 + 1;
pair<long long, long long> red[N], blue[N];
long long n, m, i, j, total[N][N];
bool lf(pair<long long, long long> first, pair<long long, long long> second) {
  return (first.second < second.second ||
          first.second == second.second && first.first < second.first);
}
pair<long long, long long> calvector(long long X, long long Y, long long a,
                                     long long b) {
  return {a - X, b - Y};
}
long long tichVH(pair<long long, long long> v1, pair<long long, long long> v2) {
  return abs(v1.first * v2.second - v1.second * v2.first);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  if (fopen("tst"
            ".inp",
            "r")) {
    freopen(
        "tst"
        ".inp",
        "r", stdin);
  }
  cin >> n >> m;
  for (i = 1; i <= n; i++)
    cin >> red[i].second >> red[i].first, red[i].second += mod,
        red[i].first += mod;
  for (i = 1; i <= m; i++)
    cin >> blue[i].second >> blue[i].first, blue[i].second += mod,
        blue[i].first += mod;
  sort(red + 1, red + n + 1, lf);
  for (i = 1; i <= n; i++) {
    for (j = i + 1; j <= n; j++) {
      long long S =
          (red[i].first + red[j].first) * (red[j].second - red[i].second);
      for (long long k = 1; k <= m; k++) {
        if (blue[k].second < red[i].second || blue[k].second > red[j].second)
          continue;
        pair<long long, long long> v1 = calvector(
            red[i].first, red[i].second, blue[k].first, blue[k].second);
        pair<long long, long long> v2 = calvector(
            red[j].first, red[j].second, blue[k].first, blue[k].second);
        pair<long long, long long> v3 =
            calvector(0, red[j].second, blue[k].first, blue[k].second);
        pair<long long, long long> v4 =
            calvector(0, red[i].second, blue[k].first, blue[k].second);
        long long sum =
            tichVH(v1, v2) + tichVH(v2, v3) + tichVH(v3, v4) + tichVH(v4, v1);
        total[i][j] += (sum == S && blue[k].second != red[i].second);
      }
    }
  }
  long long ans = 0;
  for (i = 1; i <= n; i++) {
    for (j = i + 1; j <= n; j++) {
      for (long long k = j + 1; k <= n; k++) {
        if (total[i][j] + total[j][k] == total[i][k]) ans++;
      }
    }
  }
  cout << ans;
}
