#include <stdio.h>

typedef long long ll;
int num[105][105], max = -1, vis[20], k, n, m;
struct node {
	int x1, x2;
} a[20], b[105];

void dfs(int now) {
	if (now >= k) {
		int sum = 0;
		//for (int i = 0; i < 17; i ++) printf("%d ", vis[i]);printf("\n");
		for (int i = 0; i < m; i ++) 
			if (vis[b[i].x1] && vis[b[i].x2]) 
				//printf("sum : %d + num[%d][%d] (%d)\n", sum, b[i].x1, b[i].x2, num[b[i].x1][b[i].x2]);
				sum ++;
		
		if (sum > max) max = sum;
		//printf("%d..sum : %d\n", now, sum);
		return;
	}
	int px1 = a[now].x1, px2 = a[now].x2;

	vis[px1] ++;
	//printf("%d pick : %d\n", now, px1);
	dfs(now + 1);
	vis[px1] --;



	vis[px2] ++;
	//printf("%d pick : %d\n", now, px2);
	dfs(now + 1);
	vis[px2] --;


}
int main() {
	int cnt = 0;
	scanf("%d %d", &n, &m);
	while (cnt < m) {
		scanf("%d %d", &b[cnt].x1, &b[cnt].x2);
		//num[b[cnt].x1][b[cnt].x2] ++;
		cnt ++;
	}
	int ind = 0;
	scanf("%d", &k);
	while (ind < k) {
		scanf("%d %d", &a[ind].x1, &a[ind].x2);
		ind ++;
	}
	dfs(0);
	//dfs(1);
	printf("%d\n", max);
	return 0;
}

#include <bits/stdc++.h>

using namespace std;
using ll = long long int;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  double n;
  double x2, y2, ans = 0;
  cin >> n >> x2 >> y2;

  for (ll i = 0; i < n; i++) {
    double x1, y1;
    cin >> x1 >> y1;

    double y3 = ((y2 - y1) / (x2 - x1)) * (0 - x1) + y1;

    if (y3 > ans) {
      ans = y3;
    }
  }

  cout << fixed << setprecision(9) << ans << endl;
}
