#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
template <typename T>
struct Point {
  T x, y;
  Point(T _x = 0, T _y = 0) : x(_x), y(_y) {}
  void read();
  void swap() { swap(x, y); }
  double len() const;
  Point<double> asDouble() { return Point<double>(x, y); }
  Point<T> norm() const;
  Point<T> ort() const { return Point<T>(y, -x); }
};
template <>
void Point<int>::read() {
  scanf("%d%d", &x, &y);
}
template <>
void Point<long long>::read() {
  scanf("%lld%lld", &x, &y);
}
template <>
void Point<double>::read() {
  scanf("%lf%lf", &x, &y);
}
template <typename T>
Point<T> operator-(const Point<T> &a) {
  return Point<T>(-a.x, -a.y);
}
template <typename T>
Point<T> operator+(const Point<T> &a, const Point<T> &b) {
  return Point<T>(a.x + b.x, a.y + b.y);
}
template <typename T>
Point<T> operator-(const Point<T> &a, const Point<T> &b) {
  return Point<T>(a.x - b.x, a.y - b.y);
}
template <typename T>
Point<T> operator*(const T a, const Point<T> &b) {
  return Point<T>(a * b.x, a * b.y);
}
template <typename T>
Point<T> operator*(const Point<T> &b, const T a) {
  return Point<T>(a * b.x, a * b.y);
}
template <typename T>
Point<T> operator/(const Point<T> &b, const T a) {
  return Point<T>(b.x / a, b.y / a);
}
template <typename T>
long long operator*(const Point<T> &a, const Point<T> &b) {
  return a.x * (long long)b.x + a.y * (long long)b.y;
}
template <typename T>
long long operator^(const Point<T> &a, const Point<T> &b) {
  return a.x * (long long)b.y - a.y * (long long)b.x;
}
template <typename T>
double Point<T>::len() const {
  return sqrt((double)((*this) * (*this)));
}
template <typename T>
Point<T> Point<T>::norm() const {
  return (*this) / len();
}
template <typename T>
bool operator<(const Point<T> &a, const Point<T> &b) {
  return a.x < b.x || a.x == b.x && a.y < b.y;
}
bool operator==(const Point<long long> &a, const Point<long long> &b) {
  return a.x == b.x && a.y == b.y;
}
int sign(int x) {
  if (x == 0) return 0;
  if (x > 0)
    return +1;
  else
    return -1;
}
int sign(double x) {
  if (fabs(x) < 1.0e-11) return 0;
  if (x > 0)
    return +1;
  else
    return -1;
}
template <typename T>
T sqr(T x) {
  return x * x;
}
const Point<double> INFDPnt(1.0e30, 1.0e30);
int n, m;
Point<int> a[512], b[512];
int d[512][512];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0, _n = (n); i < _n; i++) a[i].read();
  sort(a, a + n);
  for (int j = 0, _n = (m); j < _n; j++) b[j].read();
  memset(d, 0, sizeof d);
  ;
  for (int i = 0, _n = (n); i < _n; i++)
    for (int j = 0, _n = (i); j < _n; j++)
      if (a[i].x != a[j].x) {
        for (int ii = 0, _n = (m); ii < _n; ii++)
          if (a[j].x <= b[ii].x && b[ii].x < a[i].x &&
              ((b[ii] - a[j]) ^ (a[i] - a[j])) < 0) {
            d[i][j]++;
            d[j][i]--;
          }
      }
  int res = 0;
  for (int i1 = 0, _n = (n); i1 < _n; i1++)
    for (int i2 = 0, _n = (i1); i2 < _n; i2++)
      for (int i3 = 0, _n = (i2); i3 < _n; i3++) {
        int k = d[i1][i2] + d[i2][i3] + d[i3][i1];
        if (k == 0) res++;
      }
  printf("%d\n", res);
  return 0;
}
