eolymp
bolt
Try our new interface for solving problems
Problems

Java Fraction 2

Java Fraction 2

Find the sum of numerator and denominator of a given fraction.

Implement a class Fraction that uses a wrapper class MyLong.

class MyLong // Java
{
  private long a; // one private variable
  MyLong(long a) // Constructor
  public String toString() // Print a variable of type MyLong
  public long GetValue() // Return the value of the private variable
};

class Fraction
{
  MyLong numerator, denominator; // numerator and denominator
  Fraction(String s) // Constructor
  public MyLong GetNumerator() // Return numerator of type MyLong
  public MyLong GetDenominator() // Return denominator of type MyLong
  public MyLong Sum() // Return sum of numerator and denominator in the variable of type MyLong
};

Input

String in the form a/b (-1018a, b1018).

Output

Print the sum of a and b.

Time limit 1 second
Memory limit 128 MiB
Input example #1
3/4
Output example #1
7
Author Michael Medvedev