import math

first_number = int(input())
second_number = int(input())
third_number = int(input())
forth_number = int(input())

result = (math.floor((first_number + second_number) / third_number)) * forth_number
print(result)