X = input().strip() # Split into integer and decimal parts if '.' in X: integer_part, decimal_part = X.split('.') else: integer_part, decimal_part = X, '' # Handle cases where integer part is empty (e.g., ".5" becomes "0.5") if not integer_part: integer_part = '0' # Process decimal part by stripping trailing zeros processed_decimal = decimal_part.rstrip('0') # Calculate the denominator based on the processed decimal length n = len(processed_decimal) denominator = 10 ** n # Combine the integer and processed decimal parts to get the numerator combined_str = integer_part + processed_decimal numerator = int(combined_str) if combined_str else 0 # Handle case where numerator is 0 (output 0/1) if numerator == 0: print("0/1") else: # Compute GCD and reduce the fraction import math gcd_value = math.gcd(numerator, denominator) simplified_num = numerator // gcd_value simplified_den = denominator // gcd_value print(f"{simplified_num}/{simplified_den}")