H, W, M = map(int, input().split())
h = [0 for i in range(H)]
w = [0 for i in range(W)]
DP = set()
for i in range(M):
    hh, ww = map(int, input().split())
    h[hh - 1] += 1
    w[ww - 1] += 1
    DP.add((hh - 1, ww - 1))

hhh = max(h)
www = max(w)
hhhh = [i for i, x in enumerate(h) if x == hhh]
wwww = [i for i, x in enumerate(w) if x == www]
check = 0

for i in hhhh:
    for j in wwww:
        if (i, j) not in DP:
            print(hhh + www)
            exit()
print(hhh + www - 1) H, W, M = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W M 0 for i in range(H) for i in range(H) i range(H) range H for i in range(H) 0 h = [0 for i in range(H)] h [0 for i in range(H)] 0 for i in range(W) for i in range(W) i range(W) range W for i in range(W) 0 w = [0 for i in range(W)] w [0 for i in range(W)] DP = set() DP set() set for i in range(M):
    hh, ww = map(int, input().split())
    h[hh - 1] += 1
    w[ww - 1] += 1
    DP.add((hh - 1, ww - 1)) i range(M) range M hh, ww = map(int, input().split()) hh map(int, input().split()) map int input().split() ().split () input split ww h[hh - 1] += 1 h[hh - 1] h hh - 1 hh 1 1 w[ww - 1] += 1 w[ww - 1] w ww - 1 ww 1 1 DP.add((hh - 1, ww - 1)) DP.add DP add (hh - 1, ww - 1) hh - 1 hh 1 ww - 1 ww 1 hhh = max(h) hhh max(h) max h www = max(w) www max(w) max w i for i, x in enumerate(h) if x == hhh for i, x in enumerate(h) if x == hhh i x enumerate(h) enumerate h x == hhh x hhh if x == hhh i hhhh = [i for i, x in enumerate(h) if x == hhh] hhhh [i for i, x in enumerate(h) if x == hhh] i for i, x in enumerate(w) if x == www for i, x in enumerate(w) if x == www i x enumerate(w) enumerate w x == www x www if x == www i wwww = [i for i, x in enumerate(w) if x == www] wwww [i for i, x in enumerate(w) if x == www] check = 0 check 0 for i in hhhh:
    for j in wwww:
        if (i, j) not in DP:
            print(hhh + www)
            exit() i hhhh for j in wwww:
        if (i, j) not in DP:
            print(hhh + www)
            exit() j wwww if (i, j) not in DP:
            print(hhh + www)
            exit() (i, j) not in DP (i, j) i j DP print(hhh + www) print hhh + www hhh www exit() exit print(hhh + www - 1) print hhh + www - 1 hhh + www hhh www 1 wwww = [i for i, x in enumerate(w) if x == www] [i for i, x in enumerate(w) if x == www] wwww www = max(w) max(w) www M = map(int, input().split()) map(int, input().split()) M W, M = map(int, input().split()) map(int, input().split()) W H, W, M = map(int, input().split()) map(int, input().split()) H DP = set() set() DP ww = map(int, input().split()) map(int, input().split()) ww check = 0 0 check hhh = max(h) max(h) hhh w = [0 for i in range(W)] [0 for i in range(W)] w hh, ww = map(int, input().split()) map(int, input().split()) hh h = [0 for i in range(H)] [0 for i in range(H)] h hhhh = [i for i, x in enumerate(h) if x == hhh] [i for i, x in enumerate(h) if x == hhh] hhhh
H, W, M = map(int, input().split())
h = [0 for i in range(H)]
w = [0 for i in range(W)]
DP = set()
for i in range(M):
    hh, ww = map(int, input().split())
    h[hh - 1] += 1
    w[ww - 1] += 1
    DP.add((hh - 1, ww - 1))

hhh = max(h)
www = max(w)
hhhh = [i for i, x in enumerate(h) if x == hhh]
wwww = [i for i, x in enumerate(w) if x == www]
check = 0

for i in hhhh:
    for j in wwww:
        if (i, j) not in DP:
            print(hhh + www)
            exit()
print(hhh + www - 1)
