import java.math.BigInteger;

public class Euler329 {

    static boolean[] sievePrimeFlags(int limit) {
        boolean[] isPrime = new boolean[limit + 1];
        for (int i = 2; i <= limit; i++)
            isPrime[i] = true;

        for (int p = 2; p * p <= limit; p++) {
            if (isPrime[p]) {
                for (int q = p * p; q <= limit; q += p) {
                    isPrime[q] = false;
                }
            }
        }
        return isPrime;
    }

    public static String solve() {
        int squares = 500;
        String sequence = "PPPPNNPPPNPPNPN";

        boolean[] isPrime = sievePrimeFlags(squares);
        BigInteger[] state = new BigInteger[squares + 1];
        for (int i = 1; i <= squares; i++) {
            state[i] = BigInteger.ONE;
        }

        BigInteger denom = BigInteger.valueOf(squares);

        for (int step = 0; step < sequence.length(); step++) {
            char croak = sequence.charAt(step);
            for (int pos = 1; pos <= squares; pos++) {
                boolean primeSquare = isPrime[pos];
                boolean good = (croak == 'P') ? primeSquare : !primeSquare;
                if (good) {
                    state[pos] = state[pos].multiply(BigInteger.valueOf(2));
                }
            }

            denom = denom.multiply(BigInteger.valueOf(3));

            if (step + 1 < sequence.length()) {
                BigInteger[] next = new BigInteger[squares + 1];
                for (int i = 1; i <= squares; i++)
                    next[i] = BigInteger.ZERO;

                for (int pos = 1; pos <= squares; pos++) {
                    BigInteger w = state[pos];
                    if (pos == 1) {
                        next[2] = next[2].add(w.multiply(BigInteger.valueOf(2)));
                    } else if (pos == squares) {
                        next[squares - 1] = next[squares - 1].add(w.multiply(BigInteger.valueOf(2)));
                    } else {
                        next[pos - 1] = next[pos - 1].add(w);
                        next[pos + 1] = next[pos + 1].add(w);
                    }
                }
                denom = denom.multiply(BigInteger.valueOf(2));
                state = next;
            }
        }

        BigInteger numer = BigInteger.ZERO;
        for (int pos = 1; pos <= squares; pos++) {
            numer = numer.add(state[pos]);
        }

        BigInteger g = numer.gcd(denom);
        numer = numer.divide(g);
        denom = denom.divide(g);

        return numer.toString() + "/" + denom.toString();
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
