import numpy as np
h, w, m = map(int, input().split())
xy = [tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(m)]
row = np.zeros(h, np.int)
col = np.zeros(w, np.int)
for y, x in xy:
	row[y] += 1
	col[x] += 1

max_cnt_y = max(row)
max_cnt_x = max(col)
max_pair = np.sum(row == max_cnt_y) * np.sum(col == max_cnt_x)
for y, x in xy:
	if row[y] == max_cnt_y and col[x] == max_cnt_x:
		max_pair -= 1

print(max_cnt_y + max_cnt_x - (max_pair == 0)) import numpy as np numpy h, w, m = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w m tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(m) for _ in range(m) _ range(m) range m for _ in range(m) tuple(map(lambda x: int(x) - 1, input().split())) tuple map(lambda x: int(x) - 1, input().split()) map lambda x: int(x) - 1 int(x) - 1 int(x) int x 1 x input().split() ().split () input split xy = [tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(m)] xy [tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(m)] row = np.zeros(h, np.int) row np.zeros(h, np.int) np.zeros np zeros h np.int np int col = np.zeros(w, np.int) col np.zeros(w, np.int) np.zeros np zeros w np.int np int for y, x in xy:
	row[y] += 1
	col[x] += 1 y x xy row[y] += 1 row[y] row y 1 col[x] += 1 col[x] col x 1 max_cnt_y = max(row) max_cnt_y max(row) max row max_cnt_x = max(col) max_cnt_x max(col) max col max_pair = np.sum(row == max_cnt_y) * np.sum(col == max_cnt_x) max_pair np.sum(row == max_cnt_y) * np.sum(col == max_cnt_x) np.sum(row == max_cnt_y) np.sum np sum row == max_cnt_y row max_cnt_y np.sum(col == max_cnt_x) np.sum np sum col == max_cnt_x col max_cnt_x for y, x in xy:
	if row[y] == max_cnt_y and col[x] == max_cnt_x:
		max_pair -= 1 y x xy if row[y] == max_cnt_y and col[x] == max_cnt_x:
		max_pair -= 1 row[y] == max_cnt_y and col[x] == max_cnt_x row[y] == max_cnt_y row[y] row y max_cnt_y col[x] == max_cnt_x col[x] col x max_cnt_x max_pair -= 1 max_pair 1 print(max_cnt_y + max_cnt_x - (max_pair == 0)) print max_cnt_y + max_cnt_x - (max_pair == 0) max_cnt_y + max_cnt_x max_cnt_y max_cnt_x max_pair == 0 max_pair 0 max_pair -= 1 1 max_pair w, m = map(int, input().split()) map(int, input().split()) w max_pair = np.sum(row == max_cnt_y) * np.sum(col == max_cnt_x) np.sum(row == max_cnt_y) * np.sum(col == max_cnt_x) max_pair h, w, m = map(int, input().split()) map(int, input().split()) h max_cnt_x = max(col) max(col) max_cnt_x m = map(int, input().split()) map(int, input().split()) m col = np.zeros(w, np.int) np.zeros(w, np.int) col xy = [tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(m)] [tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(m)] xy row = np.zeros(h, np.int) np.zeros(h, np.int) row max_cnt_y = max(row) max(row) max_cnt_y
import numpy as np
h, w, m = map(int, input().split())
xy = [tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(m)]
row = np.zeros(h, np.int)
col = np.zeros(w, np.int)
for y, x in xy:
	row[y] += 1
	col[x] += 1

max_cnt_y = max(row)
max_cnt_x = max(col)
max_pair = np.sum(row == max_cnt_y) * np.sum(col == max_cnt_x)
for y, x in xy:
	if row[y] == max_cnt_y and col[x] == max_cnt_x:
		max_pair -= 1

print(max_cnt_y + max_cnt_x - (max_pair == 0))