#include #include #include #include #include #include #include using namespace std; struct Point { int x, y; Point(int _x = 0, int _y = 0) : x(_x), y(_y) {} bool operator == (const Point &s) { return x == s.x && y == s.y; } }; typedef Point Vector; Vector operator + (const Vector &a, const Vector &b) { return Vector(a.x + b.x, a.y + b.y); } Vector operator - (const Vector &a, const Vector &b) { return Vector(a.x - b.x, a.y - b.y); } int cross(const Vector &a, const Vector &b) { return a.x * b.y - a.y * b.x; } bool onRight(const Point &p, const Point &a, const Point &b) { return cross(b - a, p - a) < 0; } const int MAXN = 500 + 100; int n, m; Point p[MAXN], q[MAXN]; vector edg[MAXN]; int ans; void init() { for(int i = 0; i < MAXN; i++) edg[i].clear(); } bool check(const Point &a, const Point &b) { for(int i = 1; i <= n; i++) if(onRight(p[i], a, b)) return false; return true; } void build() { for(int i = 1; i <= m; i++) for(int j = 1; j <= m; j++) if(!(q[i] == q[j])) if(check(q[i], q[j])) edg[i].push_back(j); } int dis[MAXN]; int bfs(int a) { queue q; memset(dis, 0, (m + 2) * sizeof(dis[0])); dis[a] = 1, q.push(a); while(!q.empty()) { int x = q.front(); q.pop(); for(int i = 0; i < edg[x].size(); i++) { int y = edg[x][i]; if(y == a) return dis[x]; if(dis[y]) continue; dis[y] = dis[x] + 1, q.push(y); } } return m + 1; } void solve() { ans = m + 1; for(int i = 1; i <= m; i++) ans = min(ans, bfs(i)); if(n == 1) for(int i = 1; i <= m; i++) if(p[1] == q[i]) ans = min(ans, 1); if(ans == m + 1) cout << "ToT" << endl; else cout << m - ans << endl; } void work() { init(); for(int i = 1; i <= n; i++) cin >> p[i].x >> p[i].y; cin >> m; for(int i = 1; i <= m; i++) cin >> q[i].x >> q[i].y; build(); solve(); } int main() { ios::sync_with_stdio(false); // freopen("1.in", "r", stdin); // freopen("1.out", "w", stdout); while(cin >> n) work(); return 0; }