The first line contains three integers,
and
, indicating the number of carrots, the number of operations, and the constant in the first operation.
Each of the followinglines indicates an operation, the format of which is as above. It is guaranteed that
and
.
Output an integer indicating the total number of carrots.