n,m,p,*a=map(int,open(0).read().split()) if m==1: print(0) exit()