#include #include typedef long long Lint; const int maxn = 505; const int maxm = 505; struct Point { Lint x, y; void read() { scanf("%lld%lld", &x, &y); } Point operator-(const Point& rhs) const { return {x - rhs.x, y - rhs.y}; } Lint operator*(const Point& rhs) const { return x * rhs.y - y * rhs.x; } } a[maxn], b[maxm]; int n, m; int d[maxm][maxm]; bool check(int i, int j) { for (int k = 1; k <= n; k++) { int res = (b[j] - b[i]) * (a[k] - b[i]); if (res < 0) return false; } return true; } int main() { while (scanf("%d", &n) == 1) { for (int i = 1; i <= n; i++) a[i].read(); scanf("%d", &m); for (int i = 1; i <= m; i++) b[i].read(); for (int i = 1; i <= m; i++) { for (int j = 1; j <= m; j++) { d[i][j] = -1; if (i == j) continue; if (check(i, j)) d[i][j] = 1; } } for (int k = 1; k <= m; k++) { for (int i = 1; i <= m; i++) { if (d[i][k] == -1) continue; for (int j = 1; j <= m; j++) { if (d[k][j] == -1) continue; if (d[i][j] == -1 || d[i][k] + d[k][j] < d[i][j]) d[i][j] = d[i][k] + d[k][j]; } } } int ans = -1; for (int i = 1; i <= m; i++) { if (d[i][i] == -1) continue; if (ans == -1 || d[i][i] < ans) ans = d[i][i]; } if (ans == -1) puts("ToT"); else printf("%d\n", m - ans); } return 0; }