#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimization("O2")
#pragma GCC optimization("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int N = 505;
int n, m;
pair<long long, long long> red[N], blue[N];
long long cnt[N][N];
long long area(pair<long long, long long>& a, pair<long long, long long>& b,
               pair<long long, long long>& c) {
  long long d = (a.first - b.first) * (b.second - c.second) -
                (b.first - c.first) * (a.second - b.second);
  return d;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> red[i].first >> red[i].second;
  for (int i = 1; i <= m; i++) cin >> blue[i].first >> blue[i].second;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (red[i].first < red[j].first) {
        for (int k = 1; k <= m; k++) {
          if (area(red[i], red[j], blue[k]) > 0) continue;
          if (blue[k].first >= red[i].first and blue[k].first < red[j].first) {
            cnt[i][j]++;
          }
        }
        cnt[j][i] = -cnt[i][j];
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      for (int k = j + 1; k <= n; k++) {
        if (cnt[i][j] + cnt[j][k] + cnt[k][i] == 0) ans++;
      }
    }
  }
  cout << ans << "\n";
}
