A, B = input().split()

ans = (int(A) * (int(B[0])*100 + int(B[2])*10 + int(B[3]))) // 100

print((int(ans)))
A, B = input().split()

ans = int(A) * round(float(B) * 100) // 100

print((int(ans)))
A, B = input().split()
ans = (int(A) * (int(B[0]) * 100 + int(B[2]) * 10 + int(B[3]))) // 100
print((int(ans)))

A, B = input().split()
ans = int(A) * round(float(B) * 100) // 100
print((int(ans)))

-ans = (int(A) * (int(B[0]) * 100 + int(B[2]) * 10 + int(B[3]))) // 100 +ans = int(A) * round(float(B) * 100) // 100