#include<cmath>
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int monky[501];
struct q{
int x,y,t;
}tree[1001];
int m,n,num,f[1001];
struct p{
int from;
int to;
double dis;
}c[1000001];
int cmp(p a1,p a2){
return a1.dis<a2.dis;
}
int find(int x){
if(f[x]!=x) f[x]=find(f[x]);
return f[x];
}
int main(){
freopen("monkey.in","r",stdin);
freopen("monkey.out","w",stdout);
cin>>m;
for(int i=1;i<=m;i++)
cin>>monky[i];
cin>>n;
for(int i=1;i<=n;i++){
cin>>tree[i].x>>tree[i].y;
tree[i].t=i;
}
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++){
c[++num].from=tree[i].t;
c[num].to=tree[j].t;
c[num].dis=sqrt(pow(tree[i].x-tree[j].x,2)+pow(tree[i].y-tree[j].y,2));
}
stable_sort(c+1,c+1+num,cmp);
stable_sort(monky+1,monky+1+m);
int u,l=0;
for(int i=1;i<=n;i++) f[i]=i;
for(int i=1;i<=num;i++){
if(l==n-1) break;
if(find(c[i].from)!=find(c[i].to)){
f[find(c[i].from)]=find(c[i].to);
l++;
u=c[i].dis;
}
}
int tot=0;
for(int i=1;i<=m;i++)
if(monky[i]>=u)
tot++;
cout<<tot;
return 0;
}