N,V,C = map(int,input().split()) l = [] for _ in range(N): v,w = map(int,input().split()) l.append((v,w)) dp = [0] * (V + 1) for v,w in l: nx = dp.copy() for i in range(V + 1): for j in range(1,(V - i) // v + 1): nx[i + j * v] = max(nx[i + j * v],dp[i] + C + w * j) dp = nx print(max(dp))