a,b=input().split()

a=int(a)

b1=int(b[0])

b2=int(b[2:])

x=a*b1+(a*b2)//100

print(x)

a,b=input().split()

a=int(a)

b=round(float(b)*100)

x=a*b//100

print(x)

a, b = input().split()
a = int(a)
b1 = int(b[0])
b2 = int(b[2:])
x = a * b1 + (a * b2) // 100
print(x)

a, b = input().split()
a = int(a)
b = round(float(b) * 100)
x = a * b // 100
print(x)

-b1 = int(b[0]) -b2 = int(b[2:]) -x = a * b1 + (a * b2) // 100 +b = round(float(b) * 100) +x = a * b // 100