#include #include #include #include using namespace std; const int MAX=1<<28; const int N=505; int n,m; int f[N][N]; struct qq { int x,y; }a[N],b[N]; int mul (qq x,qq y,qq z) { int x1=x.x-z.x,y1=x.y-z.y; int x2=y.x-z.x,y2=y.y-z.y; return x1*y2-x2*y1; } int main() { while (scanf("%d",&n)!=EOF) { for (int u=1;u<=n;u++) scanf("%d%d",&a[u].x,&a[u].y); scanf("%d",&m); for (int u=1;u<=m;u++) scanf("%d%d",&b[u].x,&b[u].y); for (int u=1;u<=m;u++) for (int i=1;i<=m;i++) { if (u==i) { f[u][i]=MAX; continue; } int cnt=0,cnt1=0; for (int j=1;j<=n;j++) { if (mul(a[j],b[u],b[i])>0) cnt++; if (mul(a[j],b[u],b[i])<0) cnt1++; if (cnt!=0) break; } if (cnt==0) f[u][i]=1; else f[u][i]=MAX; } for (int u=1;u<=m;u++) for (int i=1;i<=m;i++) { if (f[i][u]==MAX) continue; for (int j=1;j<=m;j++) f[i][j]=min(f[i][j],f[i][u]+f[u][j]); } int ans=MAX; for (int u=1;u<=m;u++) ans=min(ans,f[u][u]); if (ans==MAX) printf("ToT\n"); else printf("%d\n",m-ans); } return 0; }