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
#include <bits/stdc++.h>
using namespace std;
const int bignumlen = 2200;
const int Blen = 8;
const long long base = 100000000;
struct bignum {
  int len;
  long long data[bignumlen];
  long long &operator[](int x) { return (data[x]); }
  const long long &operator[](int x) const { return (data[x]); }
  bignum() {
    memset(data, 0, sizeof(data));
    len = 0;
  }
  void clear() {
    for (int i = len; i >= 1; --i) data[i] = 0;
    len = 0;
  }
  int check(const bignum &a, const bignum &b) {
    if (a.len > b.len) return (0);
    if (b.len > a.len) return (1);
    for (int i = a.len; i >= 1; --i) {
      if (a.data[i] < b.data[i]) return (1);
      if (b.data[i] < a.data[i]) return (0);
    }
    return 2;
  }
  bool operator<(const bignum &b) { return (check(*this, b) == 1); }
  bool operator>(const bignum &b) { return (check(*this, b) == 0); }
  bool operator<=(const bignum &b) { return (check(*this, b) >= 1); }
  bool operator>=(const bignum &b) { return (check(*this, b) % 2 == 0); }
  bool operator!=(const bignum &b) { return (check(*this, b) != 2); }
  bool operator==(const bignum &b) { return (check(*this, b) == 2); }
  bignum operator=(const bignum &x) {
    for (int i = x.len + 1; i <= len; ++i) data[i] = 0;
    for (int i = 1; i <= x.len; ++i) data[i] = x.data[i];
    len = x.len;
    return *this;
  }
  bignum operator=(long long x) {
    for (int i = len; i >= 0; --i) data[i] = 0;
    len = 0;
    while (x) {
      data[++len] = x % base;
      x /= base;
    }
    return *this;
  }
  bignum(long long x) {
    memset(data, 0, sizeof(data));
    len = 0;
    (*this) = x;
  }
  bignum operator*(const bignum &b) {
    int i, j;
    bignum tmp;
    for (i = 1; i <= len; ++i)
      if (data[i] != 0)
        for (j = 1; j <= b.len; ++j)
          if (b.data[j] != 0) {
            tmp.data[i + j - 1] += data[i] * b.data[j];
            tmp.data[i + j] += tmp.data[i + j - 1] / base;
            tmp.data[i + j - 1] %= base;
          }
    tmp.len = len + b.len - 1;
    while (tmp.data[tmp.len + 1]) tmp.len++;
    return tmp;
  }
  bignum operator*(long long x) {
    int i;
    bignum tmp;
    for (i = 1; i <= len; ++i) tmp[i] = data[i] * x;
    tmp.len = len;
    for (i = 1; i <= len; ++i) {
      tmp[i + 1] += tmp[i] / base, tmp[i] %= base;
      if (tmp[i + 1] && i + 1 > tmp.len) tmp.len++;
    }
    return tmp;
  }
  bignum operator/(long long x) {
    int i;
    bignum tmp;
    long long y = 0;
    for (i = len; i >= 1; --i) {
      y = y * base + data[i];
      tmp[i] = y / x;
      y %= x;
    }
    tmp.len = len;
    while (tmp[tmp.len] == 0 && tmp.len > 1) tmp.len--;
    return tmp;
  }
  bignum operator/(const bignum &b) {
    if (b.len <= 1 && b[1] == 0) {
      printf("error! 被0除!");
      for (;;)
        ;
    }
    int i, l1 = (len - 1) * Blen, l2 = (b.len - 1) * Blen;
    long long x = data[len], y = b[b.len];
    while (x) x /= 10, l1++;
    while (y) y /= 10, l2++;
    bignum tmp, chu, B;
    chu = *this;
    B = b;
    for (i = 1; i * Blen <= l1 - l2; ++i) B *= base;
    for (i = 1; i <= (l1 - l2) % Blen; ++i) B *= 10;
    for (i = l1 - l2; i >= 0; --i) {
      x = 0;
      while (chu >= B) chu -= B, x++;
      tmp[i / Blen + 1] = tmp[i / Blen + 1] * 10 + x;
      B /= 10;
    }
    tmp.len = (l1 - l2) / Blen + 1;
    while (tmp.len >= 1 && !tmp[tmp.len]) tmp.len--;
    return tmp;
  }
  bignum operator+(const bignum &b) {
    bignum tmp;
    int i, l = max(len, b.len);
    for (i = 1; i <= l; ++i) tmp[i] = data[i] + b[i];
    for (i = 1; i <= l; ++i) tmp[i + 1] += tmp[i] / base, tmp[i] %= base;
    tmp.len = l;
    if (tmp[tmp.len + 1]) tmp.len++;
    return tmp;
  }
  bignum operator+(long long x) {
    bignum tmp;
    tmp = *this;
    tmp[1] += x;
    for (int i = 1; i <= len && tmp[i] >= base; ++i)
      tmp[i + 1] += tmp[i] / base, tmp[i] %= base;
    while (tmp[tmp.len + 1]) tmp.len++;
    return tmp;
  }
  bignum operator-(const bignum &b) {
    int i;
    bignum tmp;
    for (i = 1; i <= len; ++i) tmp.data[i] = data[i] - b.data[i];
    for (i = 1; i <= len; ++i) {
      if (tmp[i] < 0) tmp.data[i] += base, tmp.data[i + 1]--;
    }
    tmp.len = len;
    while (tmp[tmp.len] == 0 && tmp.len > 1) tmp.len--;
    return tmp;
  }
  bignum operator-(long long x) {
    bignum tmp;
    tmp = *this;
    tmp[1] -= x;
    for (int i = 1; i <= len && tmp[i] < 0; ++i) {
      tmp[i + 1] += (tmp[i] + 1) / base - 1;
      tmp[i] = (tmp[i] + 1) % base + base - 1;
    }
    while (!tmp[tmp.len] && tmp.len > 1) tmp.len--;
    return tmp;
  }
  long long operator%(long long x) {
    int i;
    long long y = 0;
    for (i = len; i >= 1; --i) y = (y * base + data[i]) % x;
    return y;
  }
  bignum operator%(const bignum &b) {
    if (b.len <= 1 && b[1] == 0) {
      printf("error! 被0 mod!");
      for (;;)
        ;
    }
    int i, l1 = (len - 1) * Blen, l2 = (b.len - 1) * Blen;
    long long x = data[len], y = b[b.len];
    while (x) x /= 10, l1++;
    while (y) y /= 10, l2++;
    bignum chu, B;
    chu = *this;
    B = b;
    for (i = 1; i * Blen <= l1 - l2; ++i) B *= base;
    for (i = 1; i <= (l1 - l2) % Blen; ++i) B *= 10;
    for (i = l1 - l2; i >= 0; --i) {
      while (chu >= B) chu -= B;
      B /= 10;
    }
    return chu;
  }
  bignum operator+=(const bignum &b) { return *this = (*this + b); }
  bignum operator*=(const bignum &b) { return *this = (*this * b); }
  bignum operator-=(const bignum &b) { return *this = (*this - b); }
  bignum operator/=(const bignum &b) { return *this = (*this / b); }
  bignum operator%=(const bignum &b) { return *this = (*this % b); }
  bignum operator*=(long long x) { return (*this = (*this * x)); }
  bignum operator+=(long long x) { return (*this = (*this + x)); }
  bignum operator-=(long long x) { return (*this = (*this - x)); }
  bignum operator/=(long long x) { return (*this = (*this / x)); }
  void read() {
    char c[bignumlen * Blen + 10];
    scanf("%s", c + 1);
    int l = strlen(c + 1);
    (*this).clear();
    long long x;
    for (int i = 1; i <= (l - 1) / Blen + 1; ++i) {
      x = 0;
      for (int j = l - Blen * i + 1; j <= l - Blen * i + Blen; ++j)
        if (j >= 1) x = x * 10 + c[j] - 48;
      data[++len] = x;
    }
  }
  void write() {
    printf("%I64d", data[len]);
    for (int i = len - 1; i >= 1; --i) printf("%0*I64d", Blen, data[i]);
  }
} p, q, pp, qq;
bignum gcd(const bignum &A, const bignum &B) {
  bignum a = A, b = B, res = 1;
  while (!(a[1] & 1) && !(b[1] & 1)) a /= 2, b /= 2, res *= 2;
  for (;;) {
    if (a.len == 1 && a[1] == 0) return b * res;
    if (b.len == 1 && b[1] == 0) return a * res;
    while (!(a[1] & 1)) a /= 2;
    while (!(b[1] & 1)) b /= 2;
    if (a > b)
      a -= b;
    else
      b -= a;
  }
}
void YF(bignum &A, bignum &B) {
  bignum tmp = gcd(A, B);
  A /= tmp;
  B /= tmp;
}
int n, i, x, num;
int main() {
  scanf("%d", &n);
  while (n % 2 == 0) {
    n /= 2;
    num++;
  }
  if (n == 1) {
    printf("%d/%d\n", num, 1);
    return 0;
  }
  p = 0;
  q = 1;
  pp = 1;
  qq = 1;
  for (i = n + 1;;) {
    if (i > n) {
      if (q % (i - n) == 0)
        q /= i - n;
      else
        p *= i - n;
      if (qq % (i - n) == 0)
        qq /= i - n;
      else
        pp *= i - n;
      if (p % i == 0)
        p /= i;
      else
        q *= i;
      if (pp % i == 0)
        pp /= i;
      else
        qq *= i;
    } else
      p += q;
    if (i == 1) break;
    if (i % 2 == 0)
      i /= 2;
    else
      i += n;
  }
  YF(p, q);
  p = p * qq;
  q = q * (qq - pp);
  p += q * num;
  bignum tmp = gcd(p, q);
  (p / tmp).write();
  printf("/");
  (q / tmp).write();
}
