#include <stdio.h>
#include <string.h>

int cap[202][202],flow[202][202],maxflow,visited[202];

int dfs(int cur) {
	if(cur == 201) {
		maxflow++;
		return 1;
	}
	for(int i = 0;i < 202;i++) {
		if(!visited[i] && cap[cur][i] > flow[cur][i]) {
			visited[i] = 1;
			if(dfs(i)) {
				flow[cur][i]++;
				return 1;
			}
		}
		if(!visited[i] && flow[i][cur] > 0) {
			visited[i] = 1;
			if(dfs(i)) {
				flow[i][cur]--;
				return 1;
			}
		}
	}
	return 0;
}

int main() {
	int x,y,e;
	scanf("%d %d %d",&x,&y,&e);
	for(int i = 0;i < e;i++){
		int xx,yy;
		scanf("%d %d",&xx,&yy);
		cap[0][xx+1] = 1;
		cap[xx+1][yy+101] = 1;
		cap[yy+101][201] = 1;
	}
	while(dfs(0) != 0) memset(visited,0,sizeof(visited));
	printf("%d\n",maxflow);
}

