#include #include using namespace std; const int maxn = 500 + 5 , inf = 999999999; struct point { int x , y; }a[maxn] , b[maxn]; int n , m; int f[maxn][maxn]; inline int check(point a , point b , point p) { return (b.x - a.x) * (p.y - a.y) - (b.y - a.y) * (p.x - a.x); } int main() { while (~scanf("%d" , &n)) { for (int i = 1; i <= n; i++) scanf("%d %d" , &a[i].x , &a[i].y); scanf("%d" , &m); for (int i = 1; i <= m; i++) scanf("%d %d" , &b[i].x , &b[i].y); for (int i = 1; i <= m; i++) for (int j = 1; j <= m; j++) f[i][j] = inf; for (int i = 1; i <= m; i++) for (int j = i + 1; j <= m; j++) { bool L = false , R = false; for (int k = 1; k <= n; k++) { int temp = check(b[i] , b[j] , a[k]); if (temp > 0) L = true; if (temp < 0) R = true; if (L && R) break; } if (!R) f[i][j] = 1; if (!L) f[j][i] = 1; } for (int k = 1; k <= m; k++) for (int i = 1; i <= m; i++) if (f[i][k] != inf) for (int j = 1; j <= m; j++) f[i][j] = min(f[i][j] , f[i][k] + f[k][j]); int ans = inf; for (int i = 1; i <= m; i++) ans = min(ans , f[i][i]); if (ans == inf) printf("ToT\n"); else printf("%d\n" , m - ans); } return 0; }