require 'mathn'
s = gets.chomp
if s =~ /(\d+)\.(\d*)\((\d+)\)/
    a, b, c = $1, $2, $3
    d = 10 ** ($2.size + $3.size) - 10 ** $2.size
    n = ($1 + $2 + $3).sub(/^0*/, '').to_i
    x = n / d
    puts [x.numerator, x.denominator] * ?/
else
    s =~ /(\d+)\.(\d+)/
    d = 10 ** $2.size
    n = ($1 + $2).sub(/^0*/, '').to_i
    x = n / d
    puts [x.numerator, x.denominator] * ?/
end
