f=open("vaipsis.txt", encoding="utf-8") K, L, P=[int(jupp) for jupp in f.readline().strip().split(" ")] m=[[0]*L for nr in range(P)] for nr in range(K): N, S, E, W =[int(jupp) for jupp in f.readline().strip().split(" ")] # print((L-E-W)*(P-N-S)) for veerg in range(W, L-E): for rida in range(N, P-S): m[rida][veerg]=1 #print( "\n".join([" ".join([str(lahter) for lahter in rida]) # for rida in m])) #for rida in m: print(*[str(lahter) for lahter in rida]) #Lugege kokku ühtede arv massiivis print(sum([sum(rida) for rida in m])) #Katsetage, kui suure alaga suudab programm veel #mõne sekundi jooksul vastuse arvutada