local mfl, mce = math.floor, math.ceil x = io.read() if x:find("%.") then a, b = x:match("(%d+)%.(%d+)") a = tonumber(a) bn = #b b = tonumber(b) denom = 1 for i = 1, bn do denom = denom * 10 end c = a * denom + b while c % 2 == 0 and denom % 2 == 0 do c = mfl(c / 2) denom = mfl(denom / 2) end while c % 5 == 0 and denom % 5 == 0 do c = mfl(c / 5) denom = mfl(denom / 5) end print(c .. "/" .. denom) else print(x .. "/1") end