#include <bits/stdc++.h>
using namespace std;
class Point {
 public:
  long long x, y;
  Point() {}
  Point(const long long &x, const long long &y) : x(x), y(y) {}
  ~Point() {}
  Point sub(const Point &p) const { return Point(x - p.x, y - p.y); }
  Point add(const Point &v) const { return Point(x + v.x, y + v.y); }
  long long dot(const Point &v) const { return x * v.x + y * v.y; }
  long long cross(const Point &v) const { return x * v.y - y * v.x; }
  bool operator<(const Point &p) const {
    return x < p.x || (x == p.x && y < p.y);
  }
};
int rN;
Point red[500];
int bN;
Point blue[500];
int c[500][500];
void solve() {
  cin >> rN >> bN;
  for (int i = 0; i < rN; i++) cin >> red[i].x >> red[i].y;
  sort(red, red + rN);
  for (int i = 0; i < bN; i++) cin >> blue[i].x >> blue[i].y;
  sort(blue, blue + bN);
  for (int i = 0; i < rN; i++)
    for (int j = i + 1; j < rN; j++) {
      for (int k = 0; k < bN; k++)
        if (red[i].x < blue[k].x && blue[k].x <= red[j].x) {
          c[i][j] += ((red[j].sub(red[i]).cross(blue[k].sub(red[i]))) > 0);
        }
    }
  int ans = 0;
  for (int i = 0; i < rN; i++)
    for (int j = i + 1; j < rN; j++)
      for (int k = j + 1; k < rN; k++) ans += (c[i][j] + c[j][k] == c[i][k]);
  cout << ans << endl;
}
int main() {
  ;
  solve();
  return 0;
}
