This is the modification of the problem used during the official round. Unfortunately, author's solution of the original problem appeared wrong, so the problem was changed specially for the archive.

Once upon a time in a far away kingdom lived the King. The King had a beautiful daughter, Victoria. They lived happily, but not happily ever after: one day a vicious dragon attacked the kingdom and stole Victoria. The King was full of grief, yet he gathered his noble knights and promised half of his kingdom and Victoria's hand in marriage to the one who will save the girl from the infernal beast.

Having travelled for some time, the knights found the dragon's lair and all of them rushed there to save Victoria. Each knight spat on the dragon once and, as the dragon had quite a fragile and frail heart, his heart broke and poor beast died. As for the noble knights, they got Victoria right to the King and started brawling as each one wanted the girl's hand in marriage.

The problem was that all the noble knights were equally noble and equally handsome, and Victoria didn't want to marry any of them anyway. Then the King (and he was a very wise man and didn't want to hurt anybody's feelings) decided to find out who will get his daughter randomly, i.e. tossing a coin. However, there turned out to be n noble knights and the coin only has two sides. The good thing is that when a coin is tossed, the coin falls on each side with equal probability. The King got interested how to pick one noble knight using this coin so that all knights had equal probability of being chosen (the probability in that case should always be equal to 1 / n). First the King wants to know the expected number of times he will need to toss a coin to determine the winner. Besides, while tossing the coin, the King should follow the optimal tossing strategy (i.e. the strategy that minimizes the expected number of tosses). Help the King in this challenging task.

Input

The first line contains a single integer n from the problem's statement (1 ≤ n ≤ 10000).

Output

Print the sought expected number of tosses as an irreducible fraction in the following form: "a/b" (without the quotes) without leading zeroes.

Examples

Input

2


Output

1/1


Input

3


Output

8/3


Input

4


Output

2/1
import java.math.BigInteger;
import java.util.Scanner;

public class editable {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int n2 = 0;
		while(n % 2 == 0) {
			n >>= 1;
			++n2;
		}
		if(n == 1) {
			System.out.println(n2 + "/1");
			return;
		}
		Type A = new Type(BigInteger.ZERO, BigInteger.ONE), B = new Type(BigInteger.ONE, BigInteger.ONE);
		for(int i = 1, k = 0, cnt = 0;; ++cnt) {
			for(k = 0; (i << k) < n; ++k);
			int rem = (i << k) - n;
			A = A.add(B.multiply(k));
			B = B.multiply(rem);
			B.b = B.b.shiftLeft(k).multiply(BigInteger.valueOf(i));
			if(rem == 1) {
				B.a = B.b.subtract(B.a);
				A = A.divide(B);
				break;
			}
			i = rem;
			if(cnt > 20) {
				A.reduce();
				B.reduce();
				cnt = 0;
			}
		}
		A.a = A.a.add(A.b.multiply(BigInteger.valueOf(n2)));
		A.reduce();
		System.out.println(A.a + "/" + A.b);
	}
}

class Type {
	public BigInteger a, b;
	public Type(BigInteger a, BigInteger b) {
		this.a = a;
		this.b = b;
	}
	
	public Type add(Type curr) {
		BigInteger d = this.b.gcd(curr.b);
		BigInteger y = this.b.divide(d).multiply(curr.b);
		BigInteger x = this.a.multiply(y.divide(this.b)).add(curr.a.multiply(y.divide(curr.b)));
		return new Type(x, y);
	}
	
	public Type multiply(Type curr) {
		BigInteger arb = this.a.gcd(curr.b);
		BigInteger bra = this.b.gcd(curr.a);
		BigInteger x = this.a.divide(arb).multiply(curr.a.divide(bra));
		BigInteger y = this.b.divide(bra).multiply(curr.b.divide(arb));
		return new Type(x, y);
	}
	
	public Type multiply(long curr) {
		BigInteger r = BigInteger.valueOf(curr);
		BigInteger d = r.gcd(this.b);
		r = r.divide(d);
		return new Type(this.a.multiply(r), this.b.divide(d));
	}
	
	public Type divide(Type curr) {
		Type r = new Type(curr.b, curr.a);
		return this.multiply(r);
	}
	
	public void reduce() {
		BigInteger d = this.a.gcd(b);
		this.a = this.a.divide(d);
		this.b = this.b.divide(d);
	}
}