#pragma GCC optimize(3,"Ofast","inline") #include using namespace std; typedef long long ll; typedef vector vi; typedef vector> vvi; const double EPS=1e-7; const double PI=acos(-1); const ll MOD=1000000007; int _IO=[](){ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);return 0;}(); #define REP(i, n) for (ll i = 0; i < n; i++) #define REPR(i, n) for (ll i = n; i >= 0; i--) #define FOR(i, m, n) for (ll i = m; i < n; i++) #define FORR(i, m, n) for (ll i = m; i >= n; i--) #define ALL(v) v.begin(), v.end() #define ALLR(v) v.rbegin(), v.rend() #define pb push_back template bool chmax(T& a, const T& b){if (a < b){a = b;return 1;}else return 0;} template bool chmin(T& a, const T& b){if (b < a){a = b;return 1;}else return 0;} //判断从cur到next再到query的拐弯方向 //左拐返回2,右拐返回4,不变线的话前进返回1,后退小步返回-1,后退大步返回3 template int getDirection(T*cur,T*next,T*query){ T x1=*next-*cur; T y1=*(next+1)-*(cur+1); T x2=*query-*next; T y2=*(query+1)-*(next+1); T res=x1*y2-x2*y1; if(res>0)return 2; else if(res<0)return 4; res=x1*x2+y1*y2; if(res>0)return 1; else if(abs(x2)<=abs(x1)&&abs(y2)<=abs(y1))return -1; else return 3; } const int N=500; int n,m; pairA[N],B[N]; int mat[N][N]; int solve(){ memset(mat,0x3f,sizeof(mat)); REP(i,m)REP(j,i){ bool l=false,r=false,out=false; REP(k,n){ int a=getDirection(&B[i].first,&B[j].first,&A[k].first); if(a==2){l=true;if(r)break;} else if(a==4){r=true;if(l)break;} else if(a!=-1){out=true;break;} } if(l&&r)continue; if(out)continue; if(!l&&!r)mat[i][j]=mat[j][i]=1; else if(l)mat[i][j]=1; else mat[j][i]=1; } int ans=0x3f3f3f3f; REP(k,m) REP(i,m)if(mat[i][k]<0x3f3f3f3f) REP(j,m) chmin(mat[i][j],mat[i][k]+mat[k][j]); REP(k,m) chmin(ans,mat[k][k]); return ans; } int main(){ while(~scanf("%d",&n)){ REP(i,n)scanf("%d %d",&A[i].first,&A[i].second); scanf("%d",&m); REP(i,m)scanf("%d %d",&B[i].first,&B[i].second); int ans=solve(); if(ans>m)printf("ToT\n"); else printf("%d\n",m-ans); } }