#include <bits/stdc++.h>
using namespace std;
long long n, m, dp[501][501], ans;
pair<long long, long long> r[501], b[501];
signed main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; ++i) {
    cin >> r[i].first >> r[i].second;
  }
  for (long long i = 1; i <= m; ++i) {
    cin >> b[i].first >> b[i].second;
  }
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j <= n; ++j) {
      long long A = r[j].second - r[i].second;
      long long B = r[i].first - r[j].first;
      long long C = -A * r[i].first - B * r[i].second;
      if (r[i].first < r[j].first) {
        for (long long k = 1; k <= m; ++k) {
          if (b[k].first >= r[i].first && b[k].first < r[j].first &&
              A * b[k].first + B * b[k].second + C > 0) {
            dp[i][j]++;
          }
        }
        dp[j][i] = -dp[i][j];
      }
    }
  }
  for (long long i = 1; i <= n; ++i) {
    for (long long j = i + 1; j <= n; ++j) {
      for (long long k = j + 1; k <= n; ++k) {
        if (dp[i][j] + dp[j][k] + dp[k][i] == 0) {
          ans++;
        }
      }
    }
  }
  cout << ans;
}
