//
// main.cpp
// bzoj2429
//
// Created by Candy on 9/9/16.
// Copyright © 2016 Candy. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
#include <cmath>
using namespace std;
const int N=1005,INF=1e9;
inline int read(){
int x=0,f=1;char ch=getchar();
while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}
while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}
return x*f;
}
int n,m,a[N],ans=0;
struct data{
int x,y;
}p[N];
inline double dis(int i,int j){
data a=p[i],b=p[j];
return sqrt( (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y) );
}
struct edge{
int u,v;
double w;
}e[N*N];
int cnt=0;
inline void ins(int u,int v,double w){
cnt++;
e[cnt].v=v;e[cnt].w=w;e[cnt].u=u;
cnt++;
e[cnt].v=u;e[cnt].w=w;e[cnt].u=v;
//printf("ins %d %d %f\n",u,v,w);
}
bool cmp(edge a,edge b){
return a.w<b.w;
}
void buildGraph(){
for(int i=1;i<=n;i++)
for(int j=i+1;j<=n;j++)
ins(i,j,dis(i,j));
}
int fa[N];
inline int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
double kruskal(){
double ans=0;
for(int i=1;i<=n;i++) fa[i]=i;
sort(e+1,e+1+cnt,cmp);
for(int i=1;i<=cnt;i++){
int u=e[i].u,v=e[i].v;
int f1=find(u),f2=find(v);
if(f1==f2) continue;
ans=max(ans,e[i].w);fa[f1]=f2;
}
return ans;
}
int main(int argc, const char * argv[]) {
m=read();
for(int i=1;i<=m;i++) a[i]=read();
n=read();
for(int i=1;i<=n;i++) p[i].x=read(),p[i].y=read();
buildGraph();
double mn=kruskal();
for(int i=1;i<=m;i++) if(a[i]>=mn) ans++;
printf("%d",ans);
return 0;
}