N, L, K = map(int, input().split())
task = []
for i in range(N):
temp = list(map(int,input().split()))
task.append(temp)
total_score = 0
count = 0
for i in task:
if count == K:
break
if i[1] <= L:
total_score += 140
count += 1
elif i[0] <= L:
total_score += 100
count += 1
print(total_score)
N, L, M = map(int, input().split())
easy, hard = 0,0
for i in range(N):
sub1, sub2 = map(int, input().split())
if sub2 <= L:
hard += 1
elif sub1 <= L:
easy += 1
ans = min(hard, K) * 140
if hard < K:
ans += min(K-hard, easy) * 100
print(ans)