#include <bits/stdc++.h>
using namespace std;
const double pi = 4 * atan(1);
const double eps = 1e-6;
inline int dcmp(double x) {
  if (fabs(x) < eps)
    return 0;
  else
    return x < 0 ? -1 : 1;
}
double fix_acute(double th) {
  return th < -pi ? (th + 2 * pi) : th > pi ? (th - 2 * pi) : th;
}
inline double getDistance(double x, double y) { return sqrt(x * x + y * y); }
inline double torad(double deg) { return deg / 180 * pi; }
struct Point {
  double x, y;
  Point(double x = 0, double y = 0) : x(x), y(y) {}
  void read() { scanf("%lf%lf", &x, &y); }
  void write() { printf("%lf %lf", x, y); }
  bool operator==(const Point& u) const {
    return dcmp(x - u.x) == 0 && dcmp(y - u.y) == 0;
  }
  bool operator!=(const Point& u) const { return !(*this == u); }
  bool operator<(const Point& u) const {
    return dcmp(x - u.x) < 0 || (dcmp(x - u.x) == 0 && dcmp(y - u.y) < 0);
  }
  bool operator>(const Point& u) const { return u < *this; }
  bool operator<=(const Point& u) const { return *this < u || *this == u; }
  bool operator>=(const Point& u) const { return *this > u || *this == u; }
  Point operator+(const Point& u) { return Point(x + u.x, y + u.y); }
  Point operator-(const Point& u) { return Point(x - u.x, y - u.y); }
  Point operator*(const double u) { return Point(x * u, y * u); }
  Point operator/(const double u) { return Point(x / u, y / u); }
  double operator*(const Point& u) { return x * u.y - y * u.x; }
};
namespace Vectorial {
double getDot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
double getCross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
double getLength(Point a) { return sqrt(getDot(a, a)); }
double getPLength(Point a) { return getDot(a, a); }
double getAngle(Point u) { return atan2(u.y, u.x); }
double getSignedAngle(Point a, Point b) { return getAngle(b) - getAngle(a); }
Point rotate(Point a, double rad) {
  return Point(a.x * cos(rad) - a.y * sin(rad),
               a.x * sin(rad) + a.y * cos(rad));
}
Point ccw(Point a, double co, double si) {
  return Point(a.x * co - a.y * si, a.y * co + a.x * si);
}
Point cw(Point a, double co, double si) {
  return Point(a.x * co + a.y * si, a.y * co - a.x * si);
}
Point scale(Point a, double s = 1.0) { return a / getLength(a) * s; }
Point getNormal(Point a) {
  double l = getLength(a);
  return Point(-a.y / l, a.x / l);
}
};  // namespace Vectorial
namespace Triangular {
using namespace Vectorial;
double getArea(Point a, Point b, Point c) {
  return (getCross(b - a, c - a)) / 2;
}
bool pointInTriangle(Point b, Point c, Point p) {
  double s1 = getArea(b, c, p);
  if (s1 > 0) return 0;
  if (p.x >= b.x && p.x < c.x) return true;
  return false;
}
};  // namespace Triangular
using namespace Triangular;
int pre[505][505];
pair<double, double> r[505];
void solve() {
  int n, m;
  scanf("%d%d", &n, &m);
  Point pivot;
  vector<Point> blue(m), red(n);
  for (int i = 0; i < n; i++) scanf("%lf%lf", &r[i].first, &r[i].second);
  for (int i = 0; i < m; i++) blue[i].read();
  sort(r, r + n);
  for (int i = 0; i < n; i++) red[i] = Point(r[i].first, r[i].second);
  int re = 0;
  for (int i = 0; i < n; i++) {
    for (int j = n - 1; j > i; j--) {
      int cnt = 0;
      for (int l = 0; l < m; l++) {
        cnt += pointInTriangle(red[i], red[j], blue[l]);
      }
      pre[i][j] = cnt;
      pre[j][i] = -cnt;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int l = j + 1; l < n; l++) {
        if ((pre[i][j] + pre[j][l] + pre[l][i]) == 0) re++;
      }
    }
  }
  printf("%d\n", re);
}
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
