#include<stdio.h>
int gcd(int a,int b)
{
 if(b==0)
 return a;
 else
 return gcd(b,a%b);
}
int main()
{
 int i,a,s=0,hcf,t;
 scanf("%d",&a);
 for(i=2;i<=(a-1);i++)
 {
  t=a;
  while(t!=0)
  {
   s=s+(t%i);
   t=(t/i);
  }
 }
 hcf=gcd(s,a-2);
 printf("%d/%d",(s/hcf),((a-2)/hcf));
 return 0;
}

#include<stdio.h>

int gcd( int x, int y )
{
  int c = x % y;
  if (c==0) return( y ); else return( gcd( y, c ) );
}

main()
{
  int i, o, p, j, k, l, n, m;

  scanf( "%d", &n );

  m = 0;
  for (i=2;i<n;++i)
  {
    p = n;
    while( p>0 ){ m+=p%i; p/=i;}
  }

  n = n - 2;
  k = gcd( m, n );
  n /= k;
  m /= k;

  printf( "%d/%d\n",m, n );
  return 0;
}

#include<stdio.h>
//int arr[10100];
int sum;
int n;
int k;
int gcd (int a,int b)
{
    if(b==0)
    return a;
    else
    return gcd(b,a%b);
}

int fun(int d,int n)
{
    int rem;
    int sum=0;
    while(n)
    {
        sum+=n%d;
        n/=d;
    }
    return sum;

}

int main()
{

    scanf("%d",&n);
    //printf("%d\n",n);
    int i;

    for(i=2;i<n;i++)
    {

        sum+=fun(i,n);

    }
    k=n-2;
    //printf("%d\n",sum);
    //printf("%d\n",k);
    int g=gcd(k,sum);

    printf("%d/%d",sum/g,k/g);
    return 0;
}

#include<stdio.h>

int main()
{
  int pp,qq,t,i,j,k,count=0;
  scanf("%d", &t);
  for(i=2;i<t;i++)
  {
    k=t;
    while(k!=0)
    {
      count+=k%i;
      k=k/i;
    }
  }
  qq=t-2;
  for(pp=2;pp<1000;pp++)
  {
    if(count%pp==0 && qq%pp==0)
    {
      count=count/pp;
      qq=qq/pp;
      pp=1;
    }
  }
  printf("%d/%d\n", count, qq);
  return 0;
}

#include<stdio.h>

int gcd (int a, int b)
{
    return (b == 0) ? a : gcd (b, a%b);
}

int main()
{
    int N, i, j;
    int sum, cnt, x ,y;
    scanf("%d", &N);

    sum = 0;
    cnt = 0;

    for(i = 2; i < N; i++, cnt++)
    {
        j = N;
        while(j)
        {
            sum += j % i;
            j /= i;
        }
    }

    x = sum / gcd(sum,cnt);
    y = cnt / gcd(sum,cnt);

    printf("%d/%d\n", x, y);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int pgcd(int x,int y)
    {
        if (x==y) return x;
        if (x==0) return y;
        if (y==0) return x;
        if (x<y) return pgcd(x,y%x);
        return pgcd(x%y,y);
    }

main()
    {
        int a,i,s,x,y;
        scanf("%d",&a);
        s = 2;
        for (i=2;i<a-1;i++)
            {
                x = 1;
                while (x<=a) x = x * i;
                x = x / i;
                y = a;
                while (y!=0)
                    {
                        s = s + (y/x);
                        y = y % x;
                        x = x / i;
                    }
            }
        y = pgcd(s,a-2);
        printf("%d/%d",s/y,(a-2)/y);
    }

#include<stdio.h>
int gcd(int,int);
int main()
{
	int n,a,i,sum=0,b,h,l,m;
	scanf("%d",&n);
	b=n;
	for(i=2;i<n;i++)
	{
		while(b!=0)
		{
		a=b%i;
		sum+=a;
		b/=i;
		}
		b=n;

	}
	h=gcd(sum,b-2);
	l=sum/h;
	m=(b-2)/h;

	printf("%d/%d",l,m);
	return 0;
}
int gcd(int x,int y)
{
	int r;
	if(y)
		r=gcd(y,x%y);
	else
		r=x;
	return r;
}

#include<stdio.h>

#define A 10
#define B 11
#define C 12
#define D 13
#define E 14
#define F 15
//a
int sum=0;
int binary (int n,int m)
{
    int c,count=0,n1,i=0,bit[1100],d;
    n1=n;
    while(n!=0)
    {
        c=n%m;
        n=n/m;
        count++;
    }
    n=n1;
    c=0;
    while(n>0)
    {
        c=n%m;
        if(c==10)
            c=A;
        else if(c==11)
            c=B;
        else if(c==12)
            c=C;
        else if(c==13)
            c=D;
        else if(c==14)
            c=E;
        else if(c==15)
            c=F;
        n=n/m;
        bit[i]=c;
        i++;
    }
    for(i=count-1;i>=0;i--)
       {
            //printf("%d",bit[i]);
            sum=sum+bit[i];
       }
      // printf("\n");
}
int gcd(int m,int n)
{
    int x,i,gcd;
    x=(m<n)?m:n;
    for(i=x;i>=1;)
    {
        if(m%i==0&&n%i==0)
             {gcd=i;break;}
        else i=i-1;
    }
    return gcd;
}
main()
{
    int a,i,g;
    scanf("%d",&a);
    for(i=2;i<a;i++)
    {
       binary(a,i);
    }
    //g=gcd(sum,a-2);
    printf("%d/%d",(sum/gcd(sum,a-2)),(a-2)/gcd(sum,a-2));
}

#include <stdio.h>
#include <stdlib.h>
int hcf(int a,int b)
  {  int t=a%b ;

  while(t>0)
   {   a=b;
       b=t;
       t=a%b;
   }
      return b;
  }

int main()
{
    int a,n,s=0,t,z;
    scanf("%d",&a);
    int i=2;
    while(i<a)
    {   t=0;
        n=a;
        while(n>0)
        {
            t=t+n%i;
            n=n/i;
        }
       s=s+t;
       i++;

    }

    z=hcf(s,a-2);
    printf("%d/%d",s/z,(a-2)/z);
    return 0;
}

#include<stdio.h>
int
gcdr ( int a, int b )
{
	  if ( a==0 ) return b;
	    return gcdr ( b%a, a );
}

int main()
{
	int n,temp,sum,msum,b,tc;
//	scanf("%d",&tc);
//	while(tc--)
//	{
	scanf("%d",&n);int t=n-2;
	msum=0;
	for(b=2;b<=n-1;b++)
	{
		 sum=0;
		temp=n;
		while(temp!=0)
		{
			sum+=temp%b;
			temp=temp/b;
		}
		msum+=sum;
	}
	printf("%d/%d\n",msum/gcdr(msum,t),t/gcdr(msum,t));
//	}
	return 0;
}

#include<stdio.h>
int main()
{
    int n,m,i,sum=0,a,count=0,g;
    scanf("%d",&n);
    m=n;
    for(i=2;i<=n-1;i++)
    {

        while(n!=0)
        {
          a=n%i;
          sum+=a;
          n=n/i;
        }
        count++;
        n=m;
    }
    g=gcd(sum,count);
     printf("%d/%d\n",sum/g,count/g);
    return 0;
}
int gcd(int a,int b)
 {
  if(b==0)
    return a;
    else
  return gcd(b,a%b);
}

#include<stdio.h>

int main()
{
    int n,sum=0,i,mod,a,nu,de;

    scanf("%d",&n);

    for(i=2;i<=(n-1);i++)
    {
        a=n;
        while(a!=0)
        {
            mod=a%i;
            a=(int)(a/i);
            sum=sum+mod;
        }
    }
    nu=sum;
    de=n-2;

    for(i=(n-2);i>=2;i--)
    {
        if(nu%i==0 && de%i==0)
        {
            nu=sum/i;
            de=(n-2)/i;

        }

    }

  printf("%d/%d",nu,de);
  return 0;
}

#include <stdio.h>
int gcd(int a,int b)
{
    int temp,g;
    if(a==0 || b==0) g=0;
    else {
        while(b>0){
            temp=b;
            b=a%b;
            a=temp;
        }
        g=a;
    }
    return g;
}
int main()
{
    int n,m,i,x=0,ans,y,g;
    scanf("%d",&n);
    y=n-2;
    for(i=2;i<=n-1;i++){
        m=n;
        while(m>0){
            x=x+m%i;
            m=m/i;
        }
    }
    g=gcd(x,y);
    x=x/g;
    y=y/g;
    printf("%d/%d",x,y);
    return 0;
}

#include<stdio.h>
int main()
{
    int a,i,j,k,sum=0;
    scanf("%d",&a);
    for(i=a-1;i>1;i--)
    {
	j=a;
	while(j!=0)
	{
	    sum=sum+j%i;
	    j=j/i;
	}
    }
    k=a-2;//finding GCD of a-2 & sum;
    for(i=2;i<=k;i++)
    {
	while(sum%i==0 && k%i==0)
	{
	    sum=sum/i;
	    k=k/i;
	}
    }
    printf("%d/%d",sum,k);
}

#include<stdio.h>
#include<math.h>
int gcd(a,b)
{
    if(a==0)
        return b;
    else
        gcd(b%a,a);
}
int main()
{
    int x,y,c,i,b,n,a,sum=0;
    while(scanf("%d",&a)==1)
    {
        for(i=2;i<a;i++)
        {
            n=a;
            do
            {
                sum=sum+n%i;
                n=n/i;
            }while(n!=0);
        }
        c=a-2;
        x=sum>c?sum:c;
        y=sum<c?sum:c;
        b=gcd(y,x);
        printf("%d/%d\n",sum/b,(a-2)/b);
        sum=0;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int num,sum=0,i,rem=0,div,real,k,gcd;
    scanf("%d",&num);
    real=num;
    i=num-1;
    while(1)
    {
        if(i<2) break;
        while(1)
        {
            div=num/i;
            rem=num%i;
            sum=sum+rem;
            //printf("%d ",rem);
            if(div==0) break;
            num=div;
        }
       // printf("\n");
        num=real;
        i--;
    }
    for(k=1;k<=num-2;k++)
    {
        if(sum%k==0 && (num-2) %k==0)
        {
            gcd=k;
        }
    }

    printf("%d/%d",sum/gcd,(num-2)/gcd);
}

#include<stdio.h>
int search(int ,int);
int gcd(int,int);
int main()
{
   int a,p;
   scanf("%d",&a);
   int b=a-2,sum=0,k;
   for(int i=2;i<=a-1;i++)
   {
      k=search(a,i);
      sum=sum+k;
   }
   p=gcd(sum,b);
   printf("%d/%d",(sum/p),(b/p));
   return 0;
}
int search(int i,int j)
{
   int sum=0,t;
   while(i>0)
   {
      t=i%j;
      i=i/j;
      sum=sum+t;
   }
   return sum;
}
int gcd(int i,int j)
{
   int temp;
   while(j!=0)
   {
     temp=j;
     j=i%j;
     i=temp;
   }
   return i;
}

#include <stdio.h>

int gcd (int a, int b)
{
    while (a && b)
        if (a > b)
            a %= b;
        else
            b %= a;
    return a + b;
}

int main ()
{
    int A;
    scanf ("%d", &A);
    int sum = 0;
    for (int i = 2; i < A; i++)
    {
        int a = A;
        while (a != 0)
        {
            sum += a % i;
            a /= i;
        }
    }

    int num = sum;
    int den = A - 2;
    int gcdval = gcd(num, den);
    num /= gcdval;
    den /= gcdval;
    printf ("%d/%d\n", num, den);
    return 0;
}

#include<stdio.h>

int fun(int,int);

int main()
{
 int X,Y,A,i,x;

 X = Y = 0;

 scanf("%d",&A);

 for(i=2;i<=A-1;i++)
  {
   Y++;

   x = fun(A,i);

   X += x;
  }

  x = (X<=Y)?X:Y;

  for(i=2;i<=x;i++)
  {
   while((X%i==0) && (Y%i==0))
    {
     X/=i;
     Y/=i;
    }

  }

  printf("%d/%d",X,Y);

  return 0;

}

int fun(int n,int base)
{
 int sum = 0;

 while(n!=0)
  {
   sum += n % base;
   n /= base;
  }

  return sum;
}

#include <stdio.h>
int GCD(int x, int y)
{
    while(x != y && x != 1 && y != 1)
    {
        if(y > x)
            y -= x;
        else if(x > y)
            x -= y;
    }
    if(y > x)
    {
        return x;
    }
    else if(x > y)
    {
        return y;
    }
    else
    {
        return x;
    }
}
int main()
{
    int a , b , counter = 0 , sum = 0 , i , gcd;
    scanf("%I64d",&a);
    for(i = 2;i < a;i++)
    {
        b = a;
        while(b > 0)
        {
            sum += b%i;
            b /= i;
        }
        counter++;
    }
    gcd = GCD(counter , sum);
    sum /= gcd;
    counter /= gcd;
    printf("%d/%d",sum,counter);
    return 0;
}

#include <stdio.h>
int gcd(int x,int y)
{
    if(y==0)
        return x;
    else
        return gcd(y,x%y);
}

int main()
{
    int n,i,j,k,x,y,z,sum=0;
    scanf("%d",&n);
    x=n;
    for(i=2; i<n; i++)
    {
        while(x>0)
        {
            sum+=(x%i);
            x=x/i;
        }
        x=n;
    }
    y=gcd(sum,n-2);
    sum=sum/y;
    z=(n-2)/y;
    printf("%d/%d",sum,z);
    return 0;
}

#include<stdio.h>
int hcf(a,b){int i;
for(i=b;i>0;i--)
{if((a%i==0)&&(b%i==0)) return i;}}
int main(void)
{   int j,n,num,p;
    int s=0;
    scanf("%d",&n);
    for(j=2;j<n;j++)
    {
    num=n;
    while(num>0)
    {s+=num%j;
    num=num/j;
     }}p=hcf(s,n-2);
     printf("%d/%d",s/p,(n-2)/p);
   return 0;
   }

#include <stdio.h>
int main(void)
{
    long gongyueshu(long x ,long y);
    long n,i,m,r,j,b=1;  long sum=0;
    while (scanf("%ld",&n)!=EOF){sum=0;
    for (i=2;i<n;i++)
    {
        m=0;j=n;
        while (j)
        {
            r=j%i;
            j=j/i;
            sum+=r;
            }
    }
    b=gongyueshu(sum,(n-2));
    //printf("%ld %ld %ld\n",b,sum,(n-2));
    printf("%ld/%ld\n",sum/b,(n-2)/b);
    }
}
long gongyueshu(long x,long y)
{
    long temp,r=1;
    if (x<y){temp=x;x=y;y=temp;}
    while (r)
    {
        r=x%y;
        x=y;
        y=r;
        }
    return (x);
}

#include <stdio.h>
#include <stdlib.h>

int sum_base_x(int *input, int *base);
int gcd(int a, int b);

int main(int argc, char *argv[])
{
    int A;
    scanf("%d", &A);

    // find the representations for A in base 2 ~ (A-1)
    int i;
    int numerator = 0;
    for(i = 2; i <= A-1; i++){
        numerator += sum_base_x(&A, &i);
    }

    int denominator = A - 2;

    int gg = gcd(numerator, denominator);

    printf("%d/%d\n", numerator/gg, denominator/gg);

    //system("PAUSE");
    return 0;
}

int sum_base_x(int *input, int *base){
    int dividend = *input;
    int result = 0;
    while(*base * (*base - 1) < dividend){
        result += dividend % *base;
        dividend /= *base;
    }

    result += (dividend % *base) + (dividend / *base);
    return result;
}

int gcd(int a, int b){
    int g = 0;
    while(a != 0 && b != 0){
        if(a >= b){
            a %= b;
            g = b;
        }
        else{
            b %= a;
            g = a;
        }
    }

    return g;
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
long long resultaCb(long long n,long long m)
{
     if(n<m)
     return 0;
     int i,t=1,ans=1;
     for(i=n;i>m;i--)/*Computation of the combination aCb*/
     {
          ans*=i;
          ans/=t++;
     }
     return ans;
}
int gcd(int a,int b)
{
     int t=0;
     while(b)
     {
          t=b;
          b=a%b;
          a=t;
     }
     return a;
}
int result(int n,int i)
{
     int dgt=0;
     while(n)
     {
          dgt+=(n%i);
          n/=i;
     }
     return dgt;
}
int cmpfunc(const void*a,const void*b)
{
    return (*(int*)a - *(int*)b);
}
int main()
{
    int n,m,i,j,sum=0,chk=0,z=0,k=0,t=0,s=0,max=0,min=0,d=0;
    int a[2000005]={0},b[5000]={0},c[1000001]={0},y[1000001]={0};
    scanf("%d",&n);
    for(i=2;i<n;i++)
    {
         max=result(n,i);
         sum+=max;
        // printf("%d\n",max);
    }
    chk=gcd(sum,n-2);
    printf("%d/%d",sum/chk,(n-2)/chk);
    return 0;

}

#include <stdio.h>

int GCD(int a,int b);
int main()
{
    int n,z=0,x,y,j,sum,m;
    scanf("%d", &n);
    for (j=2; j<n; j++){
        sum=0;
        m=n;
        while(m){
            sum+=(m%j);
            m/=j;
        }
        z+=sum;
    }

    x=GCD(z,n-2);
    z=z/x;
    y=(n-2)/x;

    printf("%d/%d", z,y);
    return 0;
}

int GCD(int a, int b)
{
    if (a%b==0) return b;
    return GCD(b,a%b);
}

#include <stdio.h>

int GCD(int m, int n)
{
    int r = m % n;
    while (r != 0)
    {
        m = n;
        n = r;
        r = m % n;
    }
    return n;
}

int main()
{
    int A;
    scanf("%d", &A);

    int X = 0, Y = A-2;
    for (int base = 2; base < A; ++base)
    {
        int n = A, ds = 0;
        while (n != 0)
        {
            ds += n % base;
            n /= base;
        }
        X += ds;
    }

    int gcd = GCD(X, Y);
    X /= gcd;
    Y /= gcd;
    printf("%d/%d\n", X, Y);
    return 0;
}

//
//  main.c
//  Numbers 13A
//
//  Created by Petrucio on 10/27/20.
//  Copyright © 2020 Petrucio. All rights reserved.
//

#include <stdio.h>
int main(){
    long int n,i,l,j,k,s=0;
    scanf("%ld",&n);
    for(i=2;i<n;i++)for(l=n;l;l/=i)s+=l%i;
    for(l=s,j=n-2;k=l%j;)l=j,j=k;
    printf("%ld/%ld\n",s/j,(n-2)/j);
    return 0;
}

#include<stdio.h>
int HCF(int a,int b)
{
int c;
while(b!=0)
{
c=a%b;
a=b;
b=c;
}
return a;
}

int main()
{
int A,i,b;
scanf("%d",&A);
int num,sum=0;
for(i=2;i<A;i++)
{
num=A;
while(num!=0)
{
b=num%i;
sum+=b;
num/=i;
}
}
if(HCF(sum,A-2)==1 )
{
printf("%d/%d",sum,(A-2));
}
else
{
b=HCF(sum,A-2);
printf("%d/%d",sum/b,(A-2)/b);
}
return 0;
}

#include <stdio.h>

int n, s=0, z, b, numitor, dc;
int numcom(int a, int b)
{
    if(a==b) return a;
    else if(a>b) return numcom(a-b, b);
    else return numcom(a, b-a);
}

int main()
{
    scanf("%d", &n);
    numitor=n-2;

    for(b=2; b<n; b++)
    {
        z=n;
        while(z>0)
        {
            s=s+z%b;
            z=z/b;
        }
    }
    dc=numcom(numitor, s);
    printf("%d/%d", s/dc, numitor/dc);

    return 0;
}

#include<stdio.h>
main()
{
    int n,sum=0,i;
    scanf("%d",&n);
    if(n>2)
    {
        for(i=2;i<n;i++)
        sum+=sumd(n,i);
    }
    int k=n-2;

    reduce(sum,k);
    return 0;

}
int sumd(int a,int b)
{  int d=0;
    while(a>b-1)
    {
        d+=a%b;
        a/=b;
    }
    d+=a;
    return (d);
}
void reduce(int n,int d)
{
    int max,p,q,i;
     if(n>d) max = n;
     else max=d;
     p=n;
     q=d;
     for(i=2;i<=max;i++)
     {
      while(n%i ==0 && d%i ==0)
      {
        n/=i;
        d/=i;
        }
      }
     printf("%d/%d",n,d);
     return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
int digit(int a)
{
    int sum=0;
    while(a>0){
        a/=10;
        sum++;
    }
    return sum;
}
int digitsum(int a)
{
    int r,sum=0;
    while(a>0){
        r=a%10;
        a/=10;
        sum+=r;
    }
    return sum;
}
int power(int a,int b)
{
    int i,sum=1;
    for(i=1;i<=b;i++){
        sum*=a;
    }
    return sum;
}
int type(int num,int base)
{
    int r,sum=0,i=0;
    while(num>0){
        r=num%base;

        sum+=r*power(10,i);
        num/=base;
        i++;
    }
    return digitsum(sum);
}
*/
int summ(int num,int base)
{
    int sum=0,r;
    while(num>0){
        r=num%base;
        sum+=r;
        num/=base;
    }
    return sum;
}

/*
int convert(int num,int base)
{
    int num1;
    num1=type(num,base);
    int r,sum=0;
    while(num1>0){
        r=num1%10;
        sum+=r*power(base,digit(num1)-1);
        num/=10;
    }
    return digitsum(sum);
}
*/
int main()
{
    int A,i,sum=0,x=0,y=0;
    scanf("%d",&A);
    for(i=2;i<=A-1;i++){
        sum+=summ(A,i);
    }

    x=sum;
    y=A-2;
    for(i=2;i<=A-2;i++){
        if(sum%i==0 &&(A-2)%i==0){
            x=sum/i;
            y=(A-2)/i;
        }
    }
    printf("%d/%d",x,y);

    return 0;
}
/*
int main()
{
    int n,i,c=0;
    scanf("%d",&n);
    int a[301];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    while(c<n){
        for(i=0;i<n;i++){
            if(a[i]>0){
                printf("P");
                a[i]--;
            }
            if(a[i]==0){
                a[i]=-1;
                c++;
            }

            if(i<n-1){
                printf("R");
            }

        }
        if(c<n){
           printf("L");
           for(i=n-2;i>=0;i--){

            if(i>0 && i!=n-2){
                printf("L");
            }

            if(a[i]>0){
                printf("P");
                a[i]--;
            }
            if(a[i]==0){
                a[i]=-1;
                c++;
            }

        }
        }

    }
    int *p,q;
    p=&q;
    q=10;

    printf("%p\n",p);
    printf("%d\n",*p);
    printf("%p\n",&q);
    p=p++;
    printf("%p\n",p);
    p=(p++);
    printf("%d\n",*p);
    char a[101];
    gets(a);
    printf("%s",a);
    int a[10],*p,i;
    //int i;
    for(i=0;i<5;i++){
        scanf("%d",&a[i]);
    }
    //int *p;
    p= a;
    printf("%d %d %d\n",*p,*(p+1),*(p+6));
    char str[101],*p;
    gets(str);
    p= str;
    int i;
    for(i=0;p[i];i++){
        printf("%c",p[i]);
    }
    char str[]="acdaaaaaaaaaa";
   // *(str+3)='c';
    printf("%c",*str+6);
    int a=6,i;
    for(i=1;i<3;i++) printf("%d\n",++a);
    for(i=1;i<3;i++) printf("%d\n",a++);

    char str[101],*p;
    gets(str);
    p= str;

    while(*p){
        *p++=*p-32;
    }

    printf("%s",str);

    char str1[101],str2[101],*p1,*p2;
    gets(str1);
    p1= str1+strlen(str1)-1;
    p2= str2;
    while(p1>=str1){
        *p2++=*p1--;
    }
    *p2='\0';
    printf("%s %s",str1,str2);

    char *p;
    gets(*p);
    printf("%c\n",p[2]);

    printf("%c",*(p+2));

    return 0;
}

int main()
{

    char str[101],*p;
    gets(str);
    p= str;
    while(*p!=' '){
        printf("%c",*p);
        *p++;
    }
    return 0;

}
*/

#include <stdio.h>
#include<string.h>

int gcd (int n,int d){
    int i;
    for(i = 999; i > 1 ; i--){
        if(n % i == 0 && d % i == 0)
            return i;
    }

        return -1;

}
int logic(int x,int base){
    int s = 0 ;

    while(x > 0)
    {
        s = s + x%base;
        x = x/base;
    }
  //  printf("s = %d\n",s);
    return s;
}

int main(){

    int x;
    scanf("%d",&x);
    int i;
    int sum = 0;
    for(i = 2 ; i < x ; i++){
        sum = sum + logic(x,i);
    }

    i = gcd(sum,x-2);
    if(i == -1){
    printf("%d/%d",sum,x-2);
    }
    else
        printf("%d/%d",sum/i,(x-2)/i);

}

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

int sum(int x, int b)
{
    int ans = 0;

    while(x > 0)
    {
        ans += x % b;
        x /= b;
    }

    return ans;
}

int gcd(int a, int b)
{
    return a == 0? b: gcd(b % a, a);
}

int main()
{
    int n;
    assert(scanf("%d", &n) == 1);

    int p = 0, q = 0;

    int i;
    for(i = 2; i <= n - 1; i++)
    {
        p += sum(n, i);
        q++;
    }

    int g = gcd(p, q);
    p /= g;
    q /= g;

    printf("%d/%d", p, q);
    puts("");

    return 0;
}

#include<stdio.h>

int main()
{
    int a,b;
    scanf("%d",&a);
    int i,sum=0;
    for(i=2;i<a;i++)
    {
        for(b=a;b>0;)
        {
            sum+=b%i;
            b=b/i;
        }

    }

    b=a-2;
    for(i=b;i>=2;i--)
    {
        if((sum%i==0)&&(b%i==0))
        {
            sum/=i;
            b/=i;
        }
    }
    printf("%d/%d",sum,b);
    return 0;
}

#include<stdio.h>
int lcm(int a,int b){
    if(b==0) return a;
    else return lcm(b,a%b);
}
int main(){
    int n,ans=0,i;
    scanf("%d",&n);
    for(i=2;i<n;i++){
        int temp=n;
        while(temp>0){
            ans+=temp%i;
            temp/=i;
        }
    }
    int l=lcm(ans,n-2);
    printf("%d/%d",ans/l,(n-2)/l);
    return 0;
}

#include<stdio.h>
int main()
{
	int n,temp,i,sum=0,x=0,y=0;
	scanf("%d",&n);
	for (i=2;i<n;i++)
	{
		temp=n;
		while(temp!=0)
		{
			sum=sum+temp%i;
			temp/=i;
		}
	}
	x=sum;
	y=n-2;
	i=2;
	while(i<n)
	{
		if (x%i==0 && y%i==0)
		{
			x=x/i;
			y=y/i;
		}
		if(x%i!=0 || y%i!=0)
			i++;
	}
	printf("%d/%d\n",x,y);

	return 0;
}

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>

int gcd(int x,int y){
int i,f=1;
if (x>y){
    for (i=x;i>1;i--){
        if(x%i==0){
            if(y%i==0){
                f=i;
                break;
            }
        }
    }
}
if(y>x){
    for (i=y;i>1;i--){
        if(x%i==0){
            if(y%i==0){
                f=i;
                break;
            }
        }
    }
}
if (x==y){
    f=x;
}
return f;
}

int convert(int x,int y)
{
    int z=0;
    while(x>0)
    {
        z+=x%y;
        x=x/y;
    }
    return z;
    }

int main()
{
    int n,i,sum=0;
    scanf("%d",&n);
    for(i=2;i<n;i++)
    {
        sum+=convert(n,i);
    }
    int f=gcd(sum,n-2);
    if(f!=1)
    {
        sum/=f;
        n=n-2;
        n/=f;
        n=n+2;
    }
    printf("%d/%d",sum,n-2);
    return 0;
}

#include <stdio.h>

 int
gcd (int a, int b)
{

if (a % b == 0)

return b;

return gcd (b, a % b);

}

int
main ()
{

int n;

scanf ("%d", &n);

int num = 0;

int sum = 0;

for (int i = 2; i < n; i++)

    {

num = n;

while (num > 0)

	{

sum = sum + num % i;

num = num / i;

}

}

int d = gcd (sum, n - 2);

sum = sum / d;

printf ("%d/%d", sum, (n - 2) / d);

}

#include<stdio.h>
int func(int,int);
int gcd(int,int);
int main(void)
{
	int a,x=0,y=0;
	scanf("%d",&a);
	for (int i=2;i<a;i++)
	{
		x+=func(a,i);
		y++;
	}
	int d=gcd(x,y);
	printf("%d/%d\n",x/d,y/d);
	return 0;
}
int func(int n,int b)
{
	int result=0;
	while (n>0)
	{
		result+=(n%b);
		n/=b;
	}
	return result;
}
int gcd(int x,int y)
{
	return x?gcd(y%x,x):y;
}

#include <stdio.h>

int gcd(int a, int b)
{
     if (a < b) return gcd(b, a);

     if (a % b == 0) return b;

     return gcd(b, a % b);
}

int main()
{
     int n, x = 0, y = 0, g, i;

     scanf("%d", &n);

     for (i = 2; i < n; i++) {
	  int m = n;

	  while (m) {
	       x += m % i;
	       m /= i;
	  }

	  y++;
     }

     g = gcd(x, y);
     x /= g;
     y /= g;

     printf("%d/%d\n", x, y);

     return 0;
}

/* https://codeforces.com/contest/13/submission/18258391 (rainboy) */
#include <stdio.h>

int sum(int n, int b) {
	return n < b ? n : sum(n / b, b) + n % b;
}

int gcd(int a, int b) {
	return b == 0 ? a : gcd(b, a % b);
}

int main() {
	int a, x, y, b, g;

	scanf("%d", &a);
	x = 0;
	y = a - 2;
	for (b = 2; b < a; b++)
		x += sum(a, b);
	g = gcd(x, y);
	x /= g, y /= g;
	printf("%d/%d\n", x, y);
	return 0;
}

#include <stdio.h>
int main()
{
       int a,s=0,i,j,z;
       scanf("%d",&a);
       for(i=2;i<a;i++)
            for(j=a;j;s+=j%i,j/=i);
        for(i=s,j=a-2;z=i%j;i=j,j=z);
        printf("%d/%d",s/j,(a-2)/j);
        return 0;
}

#include <stdio.h>
int hcf(int a,int b){return b?hcf(b,a%b):a;}
int main()
{int a,i,j,h,sd=0;
scanf("%d",&a);
for(i=2;i<a;i++)
for(j=a;j;sd+=j%i,j/=i);
h=hcf(sd,a-2);
printf("%d/%d",sd/h,(a-2)/h);
   return 0;

  }

#include <stdio.h>
int cmmdc(int a, int b)
{
    if(a == b)
    {
        return a;
    }else
    {
        if(a > b)
        {
            return cmmdc(a-b,b);
        }else
        {
            return cmmdc(b-a,a);
        }
    }

}
int main()
{
    int n, b, z, numarator;
    scanf("%d",&n);

    int numitor  = n - 2;
    int s = 0;

    for(b = 2; b < n; b++)
    {
        z = n;
        while(z > 0)
        {
            s += z % b;
            z = z / b;
        }
    }
    numarator = s;
    int dc = cmmdc(numarator, numitor);
    numarator = numarator / dc;
    numitor = numitor / dc;
    printf("%d/%d",numarator,numitor);
    return 0;
}

#include<stdio.h>
int main()
{
	int k,n=0,i,r,sum=0,t;
	scanf("%d",&n);
	t=n;
	for(i=2;i<n;i++)
	{
		while(n!=0)
		{
			r=n%i;
			sum=sum+r;
			n=n/i;
		}
		n=t;
	}
	k=n-2;
	for(i=k;i>1;i--)
	{
		if(sum%i==0 && k%i==0)
		{
			sum=sum/i;
			k=k/i;
		}
	}
	printf("%d/%d",sum,k);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int A, X = 0;
    scanf("%i", &A);
    int N = A;
    for(int i=2;i<A;i++){
        while(N != 0){
            X = X + (N % i);
            N = N / i;
        }
    N = A;
    }
    int Y = A - 2;
    for(int i=0;i<100;i++){
        for(int j=2;j<Y;j++){
            if((X % j == 0) && (Y % j ==0)){
                X /= j;
                Y /= j;
                break;
            }
        }
    }

    printf("%i/%i", X,Y);
    return 0;
}

#include <stdio.h>
int main(){
    long int n,i,l,j,k,s=0;
    scanf("%ld",&n);
    for(i=2;i<n;i++)for(l=n;l;l/=i)s+=l%i;
   for(l=s,j=n-2;k=l%j;)l=j,j=k;
    printf("%ld/%ld",s/j,(n-2)/j);
}

#include<stdio.h>
int main()
{

    int i,a,s=0,num,j,x;
    scanf("%d",&a);
    for(i=2;i<a;i++)
    {
        num=a;
        while(num>0)
        {
            s=s+num%i;
            num=num/i;
        }

    }
    x=a-2;
    for(i=2;i<=x;i++)
    while(s%i==0&&x%i==0)
    {
        s=s/i;
        x=x/i;
    }
    printf("%d/%d",s,x);

    return 0;
}

#include<stdio.h>
int main()
{
	int n,i,rem,count=0,j,b;
	scanf("%d",&n);
	b=n;
	for (i=2;i<n;i++)
	{
		while(b!= 0)
		{rem = b % i;
			count+=rem;
			b = b/i;}
		b=n;
	}
	int p;
	p=(n-2);
	for(i=p;i>1;i--)
	{if (count % i == 0 && p % i == 0)
		{count /= i;
			p/= i;}
	}
	printf("%d/%d",count,p);
	return 0;
}

#include <stdio.h>

int cmmdc(int a, int b)
{
    if(a == b) return a;
    else
    if(a > b) return cmmdc(a-b,b);
    else return cmmdc(b - a,a);
}

int n, s = 0, z, b, numitor, numarator, dc;

int main()
{
    scanf("%d", &n);
    numitor = n - 2;

    for (b = 2; b < n; b++)
    {
        z = n;

        while(z > 0)
        {
            s = s + z % b;
            z = z / b;
        }
    }

    numarator = s;
    dc = cmmdc(numarator, numitor);

    printf("%d/%d", numarator / dc, numitor / dc);
    return 0;
}

#include <stdio.h>

int cmmdc(int a,int b)
{
    if(a == b) return a;
    else
    if(a > b) return cmmdc(a-b,b); else cmmdc(b - a,a);
}

int n,s = 0,z,b,numitor,numarator,dc;

int main()
{
    scanf("%d",&n);
    numitor = n - 2;
    for (b = 2;b < n;b++)
    {
        z = n;
        while(z > 0)
        {
            s = s + z % b;
            z = z / b;

        }
    }
    numarator = s;
    dc = cmmdc(numarator, numitor);
    printf("%d/%d\n", numarator / dc,numitor / dc);

    return 0;
}

#include <stdio.h>

int frac(int m, int n)
{
    int r = m % n;
    while (r != 0)
    {
        m = n;
        n = r;
        r = m % n;
    }
    return n;
}

int main()
{
    int nr, base;
    scanf("%d", &nr);

    int X=0, Y=nr-2;
    for (base = 2; base < nr; ++base)
    {
        int n=nr, ds=0;
        while (n != 0)
        {
            ds += n % base;
            n /= base;
        }
        X += ds;
    }

    int gcd = frac(X, Y);
    X /= gcd;
    Y /= gcd;
    printf("%d/%d\n", X, Y);
    return 0;
}

#include<stdio.h>
int gcd(int a,int b);
int main()
{
	int n;
	scanf("%d",&n);

	int i,no,nume=0,deno=0;
	for(i=2;i<n;i++)
	{	deno++;
		no=n;
		while(no>0)
		{

		nume=nume+no%i;
		no=no/i;
		}
	}
	 int gcd1=gcd(nume,deno);
	if(gcd1==1)printf("%d/%d",nume,deno);
	else
	{
		//int gcd1=gcd(nume,deno);
	//	printf("%d\n",gcd1);
		printf("%d/%d",nume/gcd1,deno/gcd1);
	}

}
int gcd(int a,int b)
{
	int r=5;
	while(r!=0)
	{
		r=a%b;
		a=b;
		b=r;
	}
	return a;
}

#include<stdio.h>
int main()
{
	int a,sum=0,dig,n,i,j,k;
	scanf("%d",&a);
if(a==2)
printf("1/1");
else
	for(i=2;i<a;i++)

	{
		k=a;
		while(k>=i)
		{
			dig=k%i;
			sum=dig+sum;
			k=k/i;
		}
		sum=sum+k;
	}
	n=a-2;
	for(i=n;i>=2;i--)
	{
		if(sum%i==0&&n%i==0)
		{
			sum=sum/i;
			n=n/i;
			break;
		}
	}
	printf("%d/%d",sum,n);
	return 0;
}

#include<ctype.h>
#include<limits.h>
#include<math.h>
#include<stdbool.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int calBase(int n, int base);

int main(void)
{
    int n, sum = 0;

    scanf("%d", &n);
    for(int i = 2; i < n; i++)
        sum += calBase(n, i);

    int a = sum, b = n - 2, r = a % b;

    while(r != 0)
    {
        a = b;
        b = r;
        r = a % b;
    }

    printf("%d/%d", (int)(sum / b), (int)((n - 2) / b));

    return 0;
}

int calBase(int n, int base)
{
    int sum = 0;

    while(n > 0)
    {
        sum += n % base;
        n /= base;
    }

    return sum;
}

#include <stdio.h>
#include <string.h>
int main()
{
int a,sum=0,b=2,temp,c,d=0;
scanf("%d",&a);
while(a!=b){
    temp=a;
    while(temp!=0){
        sum+=temp%b;
        temp=temp/b;

    }
    d++;
    b++;
}
int f=2;
c=d;
if(d>2){
    while(f!=c){
        if(sum%f==0 && d%f==0){
            sum/=f;
            d/=f;
        }
        if(!(sum%f==0&&d%f==0)){
         f++;
        }

    }
}
else{
d=1;
}

printf("%d/%d",sum,d);
return 0;
}

#include<stdio.h>
int main()
{
    int n, i, x, y, sum=0, s, d;
    scanf("%d",&n);
    for(i=2;i<n;i++){
        x=n;
        while(x!=0){
           y=x%i;
           sum=sum+y;
           x=x/i;
        }
    }
    for(i=(n-2);i>0;i--){
        if(sum%i==0 && (n-2)%i==0){
            s=sum/i;
            d=(n-2)/i;
            printf("%d/%d",s,d);
            return 0;
        }
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
int gcd(int a,int b)
{
    int t;
    while(b!=0)
    {
        t=b;
        b=a%b;
        a=t;
    }
    return a;
}
main()
{
    int n,i,sum=0,num,a;
    scanf("%d",&n);
    for(i=2;i<n;i++)
    {
        num=n;
        while(num)
        {
            sum+=num%i;
            num=num/i;
        }
    }
    a=gcd(sum,n-2);
    printf("%d/%d",sum/a,(n-2)/a);
    return 0;
}

#include <stdio.h>
int h(a,b){return b?h(b,a%b):a;}
int main()
{
       int a,s=0,i,j,z;
       scanf("%d",&a);
       for(i=2;i<a;i++)
            for(j=a;j;s+=j%i,j/=i);
        j=h(s,a-2);
        printf("%d/%d",s/j,(a-2)/j);
        return 0;
}

#include<stdio.h>
#include<math.h>
long sumcs(int m,int n){
	long kq=0;
	while(m>0){
		kq=kq+m%n;
		m=m/n;
	}
	return kq;
	}
long ucln(long a,long b){
	while(a%b!=0&&b%a!=0){
		if(a>b)a=a%b;else b=b%a;
	}
	if(a>b)return b;return a;
}
int main(){
long x,y,s=0;
int a,i;
scanf("%d",&a);
for(i=2;i<a;i++)s=s+sumcs(a,i);
x=s/ucln(s,a-2);y=(a-2)/ucln(s,a-2);
printf("%d/%d",x,y);
}

#include<stdio.h>
int main()
{
    int n,i,num=0,temp,x,den,j;
    scanf("%d",&n);
    for(i=2;i<n;i++)
    {
        temp=n;
        while(temp>0)
        {
            x=temp%i;
            num=num+x;
            temp=temp/i;
        }
       // printf("%d=%d\n",i,num);
    }
    for(j=n-2;j>=1;j--)
    {
        if(num%j==0 && (n-2)%j==0)
            break;

    }
    num=num/j;
    den=(n-2)/j;
    printf("%d/%d\n",num,den);
 //   main();
}

#include<stdio.h>
int main()
{
	int n=0,i,r,sum=0,t;
	scanf("%d",&n);
	t=n;
	for(i=2;i<n;i++)
	{
		while(n!=0)
		{
			r=n%i;
			sum=sum+r;
			n=n/i;
		}
		n=t;
	}

	for(i=n-2;i>1;i--)
	{
		if(sum%i==0 && n%i==0)
		{
			sum=sum/i;
			n=n/i;
		}
	}
	printf("%d/%d",sum,n-2);
	return 0;
}

#include<stdio.h>
int hcf(int a, int h)
{
	int temp;
	while(1)
	{
		temp = a%h;
		if(temp==0)
			return h;
		a = h;
		h = temp;
	}
}
int main()
{
	int n,temp,sum,msum,b;
	scanf("%d",&n);int t=n-2;
	for(b=2;b<=n-1;b++)
	{
		 sum=0;
		temp=n;
		while(temp!=0)
		{
			sum+=temp%b;
			temp=temp/b;
		}
		msum+=sum;
	}
	if(!hcf(msum,t))
	printf("%d/%d\n",msum,t);
	else
	{
		while(hcf(msum,t)>1)
		{
			msum/=hcf(msum,t);
			 t/=hcf(msum,t);
		}
	printf("%d/%d\n",msum,t);
	}
	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int base(int n,int b)
{
	int i,sum;
	sum=0;
	i=0;
	while(n!=0)
	{
		sum=sum+((pow(10,i))*(n%b));
		n=n/b;
		i=i+1;
	}
	return sum;
}
int gcd(int a,int b)
{
	int ans;
	if(a%b==0)
	{
		ans=b;
	}
	else
	{
		ans=gcd(b,a%b);
	}
	return ans;
}
int digit_sum(int n)
{
	int sum=0;
	while(n!=0)
	{
		sum=sum+(n%10);
		n=n/10;
	}
	return sum;
}
int main()
{
	int temp,num,sum,count;
	sum=0;
	count=0;
	scanf("%d",&num);
	for(int i=2;i<num;i++)
	{
		sum=sum+(digit_sum(base(num,i)));
		count=count+1;
	}
	temp=gcd(sum,count);

	printf("%d/%d",sum/temp,count/temp);
}

#include<stdio.h>

int main (){
        int A,z,i,j;
        long int reminder=0,count=0;
        scanf("%d",&A);
        z=A;
        for(i=2;i<A;i++){
            for(j=0; ;j++){
                reminder=A%i+reminder;
                A=A/i;
                if(A==0) break;
            }
            A=z;
            count++;

        }
        for(i=2; ;i++){

             if(reminder%i==0&&count%i==0){
                reminder=reminder/i;
                count=count/i;
                i=1;
            }
            else if(reminder%i!=0&&count%i!=0) break;
        }
        printf("%d/%d",reminder,count);

return 0;

}

#include <stdio.h>

int r;

void calc( int n, int base ){
   int k;
   /*printf("%d : ", base );*/
   while( n >= base ){
    k = n%base;
/*    printf("%d", k);*/
    while( k >= 10 ){ r += (k%10); k/=10; }
    r += k;
    n /= base;
   }
/*   printf("%d", k);
    printf("\n");*/
   k = n;
/*    printf("%d", k);*/
    while( k >= 10 ){ r += (k%10); k/=10; }
    r += k;
}

int main(){
     int n, i;

     scanf("%d", &n );

     r = 0;
     for( i = 2; i<n; i++ )
      calc( n, i );

    printf("%d/%d\n", r, n-2 );

 return 0;
}

#include<stdio.h>

int main()
{
    int A,i,c=0,d,r;
    scanf("%d",&A);

    for(i=2;i<A;i++){

        d = A;
        while(d!=0){

            r = d % i;
            c = c + r;
            d = d/i;

        }

    }

    printf("%d/%d",c,A-2);

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
//int ne[101];
int main()
{
  int a,i,x,s=0;
  scanf("%d",&a);
  for(i=2;i<a;i++)
  {
      x=a;
      while(x>0)
      {
          s=s+x%i;
          x=x/i;
      }
  }
  printf("%d/%d",s,a-2);
    return 0;
}

#include <stdio.h>
#include <string.h>
int main()
{
int a,sum=0,b=2,temp,c,d=0;
scanf("%d",&a);
c=a-1;
while(a!=b){
    temp=a;
    while(temp!=0){
        sum+=temp%b;
        temp=temp/b;

    }
    d++;
    b++;
}
if(sum%d==0){
    sum/=d;
    d=1;
}
printf("%d/%d",sum,d);
return 0;
}

#include<stdio.h>
int main()
{
    int num,sum=0,i,rem=0,div,real;
    scanf("%d",&num);
    real=num;
    i=num-1;
    while(1)
    {
        if(i<2) break;
        while(1)
        {
            div=num/i;
            rem=num%i;
            sum=sum+rem;
            //printf("%d ",rem);
            if(div==0) break;
            num=div;
        }
       // printf("\n");
        num=real;
        i--;
    }
    printf("%d/%d",sum,num-2);
}

#include<stdio.h>
#include<string.h>

int main()
{
  int n,i,j,k;
  int rem=0;
  scanf("%d",&n);
  rem=0;
  for(i=2;i<=n-1;i++){
     j=n;
     while(j>0){
      rem=rem+j%i;
      j=j/i;
      }
    }

  printf("%d/%d\n",rem,n-2);

return 0;
}

#include <stdio.h>
int main()
{
    long long a , b , counter = 0 , sum = 0 , i , counter1,sum1;
    scanf("%I64d",&a);
    for(i = 2;i < a;i++)
    {
        b = a;
        while(b > 0)
        {
            sum += b%i;
            b /= i;
        }
        counter++;
    }
    counter1 = counter;
    sum1 = sum;
    while(sum1 != counter1 && sum1 != 1 && counter1 != 1)
    {
        if(counter1 > sum1 )
            counter1 -= sum1;
        else if(sum1 > counter1)
            sum1 -= counter1;
    }
    if(sum == sum1)
    {
        sum1 = 1;
    }
    sum /= sum1;
    counter /= sum1;
    printf("%I64d/%I64d",sum,counter);
    return 0;
}

#include<stdio.h>

int fun(int,int);

int main()
{
 int X,Y,A,i,x;

 X = Y = 0;

 scanf("%d",&A);

 for(i=2;i<=A-1;i++)
  {
   Y++;

   x = fun(A,i);

   X += x;
  }

  for(i=2;i<=x;i++)
  {
   while((X%i==0) && (Y%i==0))
    {
     X/=i;
     Y/=i;
    }

  }

  printf("%d/%d",X,Y);

  return 0;

}

int fun(int n,int base)
{
 int sum = 0;

 while(n!=0)
  {
   sum += n % base;
   n /= base;
  }

  return sum;
}

#include<stdio.h>
int main()
{
    int n,i,num=0,temp,x;
    scanf("%d",&n);
    for(i=2;i<n;i++)
    {
        temp=n;
        while(temp>0)
        {
            x=temp%i;
            num=num+x;
            temp=temp/i;
        }
       // printf("%d=%d\n",i,num);
    }
    printf("%d/%d\n",num,n-2);
   // main();
}

#include <stdio.h>

long long int r;

void calc( int n, int base ){
   int k;
   while( n >= base ){
    k = n%base;
    while( k >= 10 ){ r += (k%10); k/=10; }
    r += k;
    n /= base;
   }
   k = n;
    while( k >= 10 ){ r += (k%10); k/=10; }
    r += k;
}

int main(){
     int n, i;

     scanf("%d", &n );

     r = 0;
     for( i = 2; i<n; i++ )
      calc( n, i );

    printf("%I64d/%d\n", r, n-2 );

 return 0;
}

#include <stdio.h>

int cmmdc(int a, int b)
{
    if(a == b) return a;
    else if (a > b) return cmmdc(a - b,b); else  return cmmdc( b - a,a);
}
int n, s, b, z, numitor, numarator, dc;
int main()
{
   scanf("%d", &n);
    numitor = n - 2;
    for(b = 2; b < n; b++)
    {
        z = n;
        while (z > 0){
            s = s + z % b;
            z = z / b;
        }
    }
    numarator = s;
    dc = cmmdc(numarator, numitor);
    printf("%d/%d ", numarator / dc, numitor /dc);
    return 0;
}

#include<stdio.h>
int main()
{
    int num,sum=0,i,rem=0,div,real,k;
    scanf("%d",&num);
    real=num;
    i=num-1;
    while(1)
    {
        if(i<2) break;
        while(1)
        {
            div=num/i;
            rem=num%i;
            sum=sum+rem;
            //printf("%d ",rem);
            if(div==0) break;
            num=div;
        }
       // printf("\n");
        num=real;
        i--;
    }
    for(k=2;k<=sum;k++)
    {
        if(sum%k==0 && (num-2) %k==0)
        {
            sum=sum/k;
            num=(num-2)/k;
            printf("%d/%d",sum,num);
            return 0;
        }
    }
    printf("%d/%d",sum,num-2);
}

#include <stdio.h>
int i, x, k, t, s, n;
int main()
{
    scanf("%d", &n);
    for(x = 2; x <= n-1; x++)
    {
        t = n;
        while (t > 0)
        {
            k = t % x;
            s += k;
            t = t / x;
        }
    }
    printf("%d/%d", s, n-2);
    return 0;
}

#include<stdio.h>
main()
{
    long int a,i,l,sum=0;
    scanf("%ld",&a);
    for(i=2;i<a;i++)
    {
        l=a;
        while(l)
        {
            sum+=l%i;
            l/=i;
        }
    }
    printf("%ld/%ld\n",sum,a-2);
    return 0;
}

//
//  main.c
//  Numbers 13A
//
//  Created by Petrucio on 10/27/20.
//  Copyright © 2020 Petrucio. All rights reserved.
//

#include <stdio.h>

int main() {
        int n,i,l,j,s=0;
        scanf("%d",&n);
        for(i=2;i<n;i++)for(l=n;l;l/=i)s+=l%i;
        printf("%d/%d",s,n-2);

    return 0;
}

#include <stdio.h>

int dsum(int n, int base) {
	return n < base ? n : dsum(n / base, base) + n % base;
}

int gcd(int a, int b) {
	return b == 0 ? a : gcd(b, a % b);
}

int main() {
	int a;
	int p, q, b, g;

	scanf("%d", &a);
	q = a - 2;
	p = 0;
	for (b = 2; b < a; b++)
		p += dsum(a, b);
	printf("%d/%d\n", p, q);
	g = gcd(p, q);
	p /= g;
	q /= g;
	printf("%d/%d\n", p, q);
	return 0;
}

#include<stdio.h>
#include<string.h>

int main(){
    int a,b=0,c,d,i,m,l=0,n;
    scanf("%d",&n);

    for(i=2;i<=n-1;i++){
        m=n;
       do{
            a=m%i;
            c=m/i;

            b=b+a;

            m=c;

        }while(m!=0);
      }

    printf("%d/%d\n",b,n-2);

    return 0;
    }

#include<stdio.h>
int func(int n,int ar[],int x)
{
    int i=0,c=0;
    while(n!=0)
    {
        ar[i++]=n%x;
        n/=x;
        c+=ar[i-1];
    }
    return c;
}
int main()
{
    int n,i,c=0;
    scanf("%d",&n);
    int ar[12];

    for(i=2;i<n;i++){
        c+=func(n,ar,i);
    }
    printf("%d/%d",c,n-2);

}

#include <stdio.h>

int r;

void calc( int n, int base ){
   int k;

   while( n >= base ){
    k = n%base;
    while( k >= 10 ){ r += k%10; k/=10; }
    r += k;
    n /= base;
   }

   r+=n;
}

int main(){
     int n, i;

     scanf("%d", &n );

     r = 0;
     for( i = 2; i<n; i++ )
      calc( n, i );

    printf("%d/%d\n", r, n-2 );

 return 0;
}

#include <stdio.h>
#include <stdlib.h>
//int ne[101];
int main()
{
  int a,i,x,s=0;
  scanf("%d",&a);
  for(i=2;i<a;i++)
  {
      x=a;
      while(x>0)
      {
          s=s+x%i;
          x=x/i;
      }
  }
  printf("%d/%d",s,a-2);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,i,j,sum=0,x,p=0,y;
    scanf("%d",&n);
    x=n;
    for(i=2;i<n;i++){
            j=1;
        while(n>0){
            if(n>=j&&n<j*i){
                sum+=1;
                n-=j;
                j=1;
            }
            else
                j*=i;
        }
        n=x;
    }
    printf("%d/%d\n",sum,n-2);

    return 0;
}

#include<stdio.h>

int main (){
        int A,z,i,j;
        long int reminder=0,count=0;
        scanf("%d",&A);
        z=A;
        for(i=2;i<A;i++){
            for(j=0; ;j++){
                reminder=A%i+reminder;
                A=A/i;
                if(A==0) break;
            }
            A=z;
            count++;
        }
        if(count%2==0)
        printf("%ld/%ld",reminder/2,count/2);
        else   printf("%ld/%ld",reminder,count);

return 0;

}

#include <stdio.h>
int n, s = 0, z, b, numitor, numarator;
int main()
{
    scanf("%d", &n);
    numitor = n - 2;
    for (b = 2; b < n; b++){
        z = n;
        while(z > 0){
            s = s + z % b;
            z = z / b;
        }
        numarator = s;
    }printf("%d/%d", numarator, numitor);
    return 0;
}

#include <stdio.h>
int n , s = 0 , z , b , numitor, numarator , dc;
int cmmnc(int a , int b)
{
    if(a == b) return a;
    else
    if(a > b) return cmmnc(a - b , b);
    else return cmmnc(b - a, a);
}
int main()
{
    scanf("%d" , &n);
    numitor = n - 2;
    for(b = 2;b < n;b++)
    {
        z = n;
        while(z > 0)
        {
            s = s + z % b;
            z = z / b;
        }
    }
    numarator = s;
    dc = cmmnc(numarator,numitor);
    printf("%d / %d\n" , numarator / dc, numitor / dc);

}

#include <stdio.h>

int sumOfDigitInBase(int number, int base)
{
    int temp = number;
    int digitSum = 0;

    while (temp > 0)
    {
        digitSum += temp % base;
        temp = temp / base;
    }

    return digitSum;
}

int n;

int main(int argc, const char * argv[]) {
    scanf("%d", &n);

    int i = 0;
    int sum = 0;

    for (i = 2; i <= n-1; i++)
    {
        sum += sumOfDigitInBase(n, i);
    }

    int numerator = sum;
    int denominator = n - 2;

    for (i = 2; i <= numerator; i++)
        if ((numerator % i == 0) && (denominator % i == 0))
        {
            numerator = numerator / i;
            denominator = denominator / i;
        }

    printf("%d/%d", numerator, denominator);
    return 0;
}

#include<stdio.h>
int main()
{
    int i,a,r,t,s,x,y;
    while(scanf("%d",&a)==1){
        x=a;
        s=0;
        for(i=2;i<=a-1;i++){
            do{
                t=a/i;
                r=a%i;
                s=s+r;
                a=t;
            }
            while(t!=0);
            a=x;
        }
        printf("%d/%d\n",s,(a-2));
    }
    return 0;
}

#include<stdio.h>
int main()
{
	long long A,i,z,sum=0,den=0;
	scanf("%lld",&A);
	z=A;
	for(i=2;i<A;i++)
	{
		den++;
		long long t=z;
		while(t!=0)
		{
			sum+=t%i;
			t/=i;
		}
	}
	printf("%lld/%lld\n",sum,den);
	return 0;
}

#include <stdio.h>
int main()
{
    int n,i,r=0,a=1,f,b;
    scanf("%d", &n);
    b = n;
    for(i=2;i<n;i++)
    {
        while(a != 0)
        {
            a = n / i;
            f = n % i;
            n = a;
            r = r + f;
        }
        n = b;
        a = 1;
            }
    printf("%d/%d",r,n-2);
    return 0;
}

#include <stdio.h>
int i, x, k, t, s, n;
int main()
{
    scanf("%d", &n);
    for(x = 2; x <= n-1; x++)
    {
        t = n;
        while (t > 0)
        {
            k = t % x;
            if(k > 9) while(k>0){s += k%10; k /= 10;}
            else s += k;
            t = t / x;
        }
    }
    printf("%d/%d", s, n-2);
    return 0;
}

#include <stdio.h>
#include <string.h>
int main()
{
int a,sum=0,b=2,temp,c,d=3;
scanf("%d",&a);
c=a-1;
while(a!=b){
    temp=a;
    while(temp!=0){
        sum+=temp%b;
        temp=temp/b;

    }
    b++;
}
if(sum%3==0){
    sum/=3;
    d=1;
}
printf("%d/%d",sum,d);
return 0;
}

#include<stdio.h>

int main()
{
  int pp,qq,t,i,j,k,count=0;
  scanf("%d", &t);
  for(i=2;i<t;i++)
  {
    k=t;
    while(k!=0)
    {
      count+=k%i;
      k=k/i;
    }
  }
  qq=t-2;
  for(pp=2;pp<1000;pp++)
  {
    if(count%pp==0 && qq%pp==0)
    {
      count=count/pp;
      qq=qq/pp;
      pp=2;
    }
  }
  printf("%d/%d\n", count, qq);
  return 0;
}

#include<stdio.h>
int main()
{
    int n,i,sum=0;
    scanf("%d",&n);
    int x=n;
    for(i=2;i<n;i++)
    {
        while(x>=i)
        {
            sum+=x%i;
            x/=i;
        }
        sum+=x;
        x=n;
    }
    int z=n-2;
    printf("%d",sum);
    printf("/%d",z);
    return 0;
}

#include <stdio.h>
int main()
{
    int A, ans = 0, tmp;
    scanf("%d", &A);
    for(int i = 2; i < A; i++)
    {
        tmp = A;
        while(tmp > 0)
        {
            ans += tmp % i;
            tmp /= i;
        }
    }
    tmp = A-2;
    for(int i = 2; i < tmp; i++)
    {
        if(ans % i == 0 && tmp % i == 0)
            ans /= i, tmp /= i;
    }
    printf("%d/%d\n", ans, tmp);
}

#include <stdio.h>
int main()
{
    int a , b , counter = 0 , sum = 0 , i;
    scanf("%d",&a);
    for(i = 2;i < a;i++)
    {
        b = a;
        while(b > 0)
        {
            sum += b%i;
            b /= i;
        }
        counter++;
    }
    printf("%d/%d",sum,counter);
    return 0;
}

# include <stdio.h>
# include <conio.h>

int main()
{
    int A,i,count,c,d,X,Y;
    scanf("%d", &A);

    count = 0;
    for(i = 2; i < A; i++){
          c = A;
          while(c != 0){
                  d = c;
                  c = c/i;
                  count = count + (d%i);
                  }
                  }

    X = count;
    Y = (A-2);
    printf("%d/%d", X,Y);
    return 0;
}

#include<stdio.h>

int main (){
        int A,z,i,j;
        long int reminder=0,count=0;
        scanf("%d",&A);
        z=A;
        for(i=2;i<A;i++){
            for(j=0; ;j++){
                reminder=A%i+reminder;
                A=A/i;
                if(A==0) break;
            }
            A=z;
            count++;

        }
        for(i=2; ;i++){

             if(reminder%2==0&&count%2==0){
                reminder=reminder/2;
                count=count/2;

            }
            else if(reminder%i!=0&&count%i!=0) break;
        }
        printf("%d/%d",reminder,count);

return 0;

}

#include <stdio.h>

int main() {
	int a, b, x;

	scanf("%d", &a);
	x = 0;
	for (b = 2; b < a; b++) {
		int a_;

		a_ = a;
		while (a_ > 0) {
			x += (a_ % b);
			a_ /= b;
		}
	}
	printf("%d/%d\n", x, a - 2);
	return 0;
}

#include<stdio.h>
int main()
{
  int p=0,i,t,n;
    scanf("%d",&n);
    for(i=2;i<n;i++)
    {
        t=n;
     while(t!=0)
     {
     p+=t%i;
     t=t/i;
     }
    }
    printf("%d/%d",p,n-2);
    return 0;
}

#include<stdio.h>
#include<string.h>

int main(){
    int a,b=0,c,d,i,m,l=0,n;
    scanf("%d",&n);

    for(i=2;i<=n-1;i++){
        m=n;
       do{
            a=m%i;
            c=m/i;

            b=b+a;

            m=c;

        }while(m!=0);
      }

    printf("%d/%d\n",b,n-2);

    return 0;
    }

#include <stdio.h>
#include <stdlib.h>

int GCD ( int , int );
int SumDigits ( int );
int ConvertToBase ( int , int );

int main( void )
{

    int A[1000];
    int n,i,total=0,G;

    scanf("%d",&n);

    for ( i=2 ; i<n ; ++i ){
        A[i] = ConvertToBase ( n , i );
    }

    for ( i=2 ; i<n ; ++i ){
        A[i] = SumDigits( A[i] );
    }

    for ( i=2 ; i<n ; ++i ){
        total += A[i];
    }

    G = GCD ( total , (n-2) );

    printf ("%d/%d" , total/G , (n-2)/G );

    return 0;
}

int GCD ( int a , int b )
{

    int temp;

    while ( b != 0 ){
        temp = b;
        b = a%b;
        a = temp ;
    }

    return a ;

}

int SumDigits ( int num )
{
    int sum=0;

    while ( num > 0 ){
        sum += num % 10 ;
        num = num / 10 ;
    }

    return sum ;
}

int ConvertToBase ( int n , int b )
{
    if ( n < b ){
        return n ;
    }
    else{
        return n%b + 10 * ConvertToBase( (n/b) , b ) ;
    }
}

#include<stdio.h>

int main()
{
int A,i,b,c;
scanf("%d",&A);
int num,sum=0;
for(i=2;i<A;i++)
{
num=A;
while(num!=0)
{
b=num%i;
sum+=b;
num/=i;
}
}

if(sum%(A-2)!=0 )
{
printf("%d/%d",sum,(A-2));
}
else
{
b=sum;
c=A-2;
while(c!=0)
{
i=b%c;
b=c;
c=i;
}
printf("%d/%d",sum/b,(A-2)/b);
}
return 0;
}

#include<stdio.h>

#define A 10
#define B 11
#define C 12
#define D 13
#define E 14
#define F 15
int sum=0;
int binary (int n,int m)
{
    int c,count=0,n1,i=0,bit[1100];
    n1=n;
    while(n!=0)
    {
        c=n%m;
        n=n/m;
        count++;
    }
    n=n1;
    c=0;
    while(n>0)
    {
        c=n%m;
        if(c==10)
            c=A;
        else if(c==11)
            c=B;
        else if(c==12)
            c=C;
        else if(c==13)
            c=D;
        else if(c==14)
            c=E;
        else if(c==15)
            c=F;
        n=n/m;
        bit[i]=c;
        i++;
    }
    for(i=count-1;i>=0;i--)
       {
            //printf("%d",bit[i]);
            sum=sum+bit[i];
       }
      // printf("\n");
}
int gcd(int m,int n)
{
    if(m==n)
        return 1;
    int temp;
    temp=n;
    n=m%n;
    m=temp;
    if(n!=0)
    gcd(m,n);

}
main()
{
    int a,i,g;
    scanf("%d",&a);
    for(i=2;i<a;i++)
    {
       binary(a,i);
    }
    //g=gcd(sum,a-2);
    printf("%d/%d",(sum/gcd(sum,a-2)),(a-2)/gcd(sum,a-2));
}

#include<stdio.h>
long int nmb(int num,int base);
int main(){
    long int i,j,n,sum=0,c=0;
    char x='/';
    scanf("%ld",&n);
    for(i=2;i<=n-1;i++){
        sum+=nmb(n,i);
        c++;
    }
    printf("%ld%c%ld",sum,x,c);
    return 0;
}
long int nmb(int num,int base){
    long int s=0,r;
    s+=num%base;     num/=base;
    while(num){
        s+=num%base;
        num/=base;
    }
    return s;
}

#include <stdio.h>
int main()
{
    int n,m,i,sum=0,ans;
    scanf("%d",&n);
    for(i=2;i<=n-1;i++){
        m=n;
        while(m>0){
            sum=sum+m%i;
            m=m/i;
        }
    }
    printf("%d/%d",sum,n-2);
    return 0;
}

#include <stdio.h>

int cmmdv(int a, int b)
{
    if(a == b) return a;
    else if (a > b) return cmmdv(a - b,b); else  return cmmdv( b - a,a);
}
int n, s, b, z, numitor, numarator, dc;
int main()
{
   scanf("%d", &n);
    numitor = n - 2;
    for(b = 2; b < n; b++)
    {
        z = n;
        while (z > 0){
            s = s + z % b;
            z = z / b;
        }
    }
    numarator = s;
    dc = cmmdv(numitor, numarator);
    printf("%d/%d ", numarator / dc, numitor /dc);
    return 0;
}

#include<stdio.h>
int main()
{
	int a,sum=0,n;
	scanf("%d",&n);
	int i;
	for(i=2;i<n;i++)
	{
         int x=n;
		while(x>0)

		{

			sum+=x%i;
			x=x/i;
			if(x<i)
			{
				sum+=x;
				break;
			}

		}

	}
	int y=n-2;
	for(i=2;i<y;i++)
	{

	if(sum%i==0&&y%i==0)
	{

		sum=sum/i;
		y=(y)/i;
		break;
	}}
	printf("%d/%d",sum,y);
	return 0;
}

#include<stdio.h>
int main()
{
	long long A,i,z,sum=0,den=0;
	scanf("%lld",&A);
	z=A;
	for(i=2;i<A;i++)
	{
		den++;
		long long t=z;
		while(t!=0)
		{
			sum+=t%i;
			t/=i;
		}
	}
	for(i=2;i<A;i++)
	{
		if(sum%i==0 && den%i==0)
		{
			sum/=i;
			den/=i;
		}
	}
	printf("%lld/%lld\n",sum,den);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int num(int a, int b){
    int ans = 0;
    while (a){
        ans += a % b;
        a /= b;
    }
    return ans;
}

int main(void)
{
    int i, a, b, sum = 0;

    scanf("%d", &a);
    for (i = 2; i < a; i++){
        sum += num(a, i);
    }
    b = a - 2;
    for (i = 2; i < ceil(sqrt(a - 2)); i++){
        if ((b) % i == 0 && sum % i == 0){
            sum /= i;
            b /= i;

        }
    }

    printf("%d/%d", sum, b);

    return 0;
}

#include<stdio.h>
int main()
{
    int i,n,a,sum=0;
    while(scanf("%d",&a)==1)
    {
        for(i=2;i<a;i++)
        {
            n=a;
            do
            {
                sum=sum+n%i;
                n=n/i;
            }while(n!=0);
        }
        printf("%d/%d\n",sum,a-2);
        sum=0;
    }
    return 0;
}

#include<stdio.h>
int fun(int d,int n)
{
    int rem;
    int sum=0;
    while(n)
    {
        sum+=n%d;
        n/=d;
    }
    return sum;

}
int main()
{
    int n;
    scanf("%d",&n);
    //printf("%d\n",n);
    int i;
    int sum=0;
    for(i=2;i<n;i++)
    {

        sum+=fun(i,n);

    }
    printf("%d/%d",sum,n-2);
    return 0;
}

# include <stdio.h>
# include <conio.h>

int main()
{
    int A,i,count,c,d,X,Y;
    scanf("%d", &A);

    count = 0;
    for(i = 2; i < A; i++){
          c = A;
          while(c != 0){
                  d = c;
                  c = c/i;
                  count = count + (d%i);
                  }
                  }

    X = count;
    Y = (A-2);
    printf("%d/%d", X,Y);
    return 0;
}

#include<stdio.h>
#include<string.h>

int main()
{
  int n,i,j,k;
   long int rem=0;
  scanf("%d",&n);
  rem=0;
  for(i=2;i<=n-1;i++){
     j=n;
     while(j>0){
      rem=rem+j%i;
      j=j/i;
      }
    }

  printf("%ld/%d\n",rem,n-2);

return 0;
}

#include<stdio.h>
int main()
{
    int n, t, i, sum = 0;
    scanf("%d", &n);
    for(i = 2; i < n; i++)
    {
        t = n;
        while(t != 0)
        {
            sum += t % i;
            t = t / i;
        }
    }
    printf("%d/%d", sum, n-2);
}

#include <stdio.h>
int main(void)
{
    long n,i,m,r,j;  long sum=0;
    while (scanf("%ld",&n)!=EOF){sum=0;
    for (i=2;i<n;i++)
    {
        m=0;j=n;
        while (j)
        {
            r=j%i;
            j=j/i;
            sum+=r;
            }
    }
    printf("%ld/%ld\n",sum,n-2);
    }
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
int digit(int a)
{
    int sum=0;
    while(a>0){
        a/=10;
        sum++;
    }
    return sum;
}
int digitsum(int a)
{
    int r,sum=0;
    while(a>0){
        r=a%10;
        a/=10;
        sum+=r;
    }
    return sum;
}
int power(int a,int b)
{
    int i,sum=1;
    for(i=1;i<=b;i++){
        sum*=a;
    }
    return sum;
}
int type(int num,int base)
{
    int r,sum=0,i=0;
    while(num>0){
        r=num%base;

        sum+=r*power(10,i);
        num/=base;
        i++;
    }
    return digitsum(sum);
}
*/
int summ(int num,int base)
{
    int sum=0,r;
    while(num>0){
        r=num%base;
        sum+=r;
        num/=base;
    }
    return sum;
}

/*
int convert(int num,int base)
{
    int num1;
    num1=type(num,base);
    int r,sum=0;
    while(num1>0){
        r=num1%10;
        sum+=r*power(base,digit(num1)-1);
        num/=10;
    }
    return digitsum(sum);
}
*/
int main()
{
    int A,i,sum=0,x,y;
    scanf("%d",&A);
    for(i=2;i<=A-1;i++){
        sum+=summ(A,i);
    }

    for(i=2;i<=A-2;i++){
        if(sum%i==0 &&(A-2)%i==0){
            x=sum/i;
            y=(A-2)/i;
        }
    }
    printf("%d/%d",x,y);

    return 0;
}
/*
int main()
{
    int n,i,c=0;
    scanf("%d",&n);
    int a[301];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    while(c<n){
        for(i=0;i<n;i++){
            if(a[i]>0){
                printf("P");
                a[i]--;
            }
            if(a[i]==0){
                a[i]=-1;
                c++;
            }

            if(i<n-1){
                printf("R");
            }

        }
        if(c<n){
           printf("L");
           for(i=n-2;i>=0;i--){

            if(i>0 && i!=n-2){
                printf("L");
            }

            if(a[i]>0){
                printf("P");
                a[i]--;
            }
            if(a[i]==0){
                a[i]=-1;
                c++;
            }

        }
        }

    }
    int *p,q;
    p=&q;
    q=10;

    printf("%p\n",p);
    printf("%d\n",*p);
    printf("%p\n",&q);
    p=p++;
    printf("%p\n",p);
    p=(p++);
    printf("%d\n",*p);
    char a[101];
    gets(a);
    printf("%s",a);
    int a[10],*p,i;
    //int i;
    for(i=0;i<5;i++){
        scanf("%d",&a[i]);
    }
    //int *p;
    p= a;
    printf("%d %d %d\n",*p,*(p+1),*(p+6));
    char str[101],*p;
    gets(str);
    p= str;
    int i;
    for(i=0;p[i];i++){
        printf("%c",p[i]);
    }
    char str[]="acdaaaaaaaaaa";
   // *(str+3)='c';
    printf("%c",*str+6);
    int a=6,i;
    for(i=1;i<3;i++) printf("%d\n",++a);
    for(i=1;i<3;i++) printf("%d\n",a++);

    char str[101],*p;
    gets(str);
    p= str;

    while(*p){
        *p++=*p-32;
    }

    printf("%s",str);

    char str1[101],str2[101],*p1,*p2;
    gets(str1);
    p1= str1+strlen(str1)-1;
    p2= str2;
    while(p1>=str1){
        *p2++=*p1--;
    }
    *p2='\0';
    printf("%s %s",str1,str2);

    char *p;
    gets(*p);
    printf("%c\n",p[2]);

    printf("%c",*(p+2));

    return 0;
}

int main()
{

    char str[101],*p;
    gets(str);
    p= str;
    while(*p!=' '){
        printf("%c",*p);
        *p++;
    }
    return 0;

}
*/

#include <stdio.h>
#include <math.h>

int main(){
    int A,i,s=0,c=0,t;
    scanf("%d",&A);
    for(i=2;i<A;i++){
       s=s+ convert(A,i);
    }

    printf("%d/%d",s,A-2);

    }
    int convert(int x,int i){
        int rem=x%i;
        if(x==0)
            return 0;
          return(rem+convert(x/i,i));

    }

#include <stdio.h>
#include <stdlib.h>

int pgcd(int x,int y)
    {
        if (x==y) return x;
        if (x==0) return y;
        if (y==0) return x;
        if (x<y) return pgcd(x,y%x);
        return pgcd(x%y,y);
    }

main()
    {
        int a,i,s,x,y;
        scanf("%d",&a);
        s = 2;
        for (i=2;i<a-1;i++)
            {
                x = 1;
                while (x<a) x = x * i;
                x = x / i;
                y = a;
                while (y!=0)
                    {
                        s = s + (y/x);
                        y = y % x;
                        x = x / i;
                    }
            }
        y = pgcd(s,a-2);
        printf("%d/%d",s/y,(a-2)/y);
    }

#include<stdio.h>

int main()
{
    int n,sum=0,i,mod,a,nu,de;

    scanf("%d",&n);

    for(i=2;i<=(n-1);i++)
    {
        a=n;
        while(a!=0)
        {
            mod=a%i;
            a=(int)(a/i);
            sum=sum+mod;
        }
    }
    nu=sum;
    de=n-2;

    for(i=(n-2);i>=2;i--)
    {
        if(sum%i==0 && (n-1)%i==0)
        {
            nu=sum/i;
            de=(n-1)/i;
        }
    }

    printf("%d/%d",nu,de);
    return 0;
}

#include<stdio.h>
#define N 1000

main()
{
   int A,i,c,d,e;
   long int j=0;
    scanf("%d",&A);
    c=A-1;d=A-2;e=A;
    for(i=2;i<=c;i++)
    {
        A=e;
        while(A!=0)
        {
            j+=(A%i);
            A/=i;
        }
    }
    printf("%ld/%d",j,d);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int A, X = 0;
    scanf("%i", &A);
    int N = A;
    for(int i=2;i<A;i++){
        while(N != 0){
            X = X + (N % i);
            N = N / i;
        }
    N = A;
    }
    int Y = A - 2;
    for(int i=0;i<100;i++){
        for(int j=2;j<10;j++){
            if((X % j == 0) && (Y % j ==0)){
                X /= j;
                Y /= j;
            }
        }
    }

    printf("%i/%i", X,Y);
    return 0;
}

#include <stdio.h>
int main()
{
    int n,i,r=0,a=1,f,b;
    scanf("%d", &n);
    b = n;
    for(i=2;i<n;i++)
    {
        while(a != 0)
        {
            a = n / i;
            f = n % i;
            n = a;
            r = r + f;
        }
        n = b;
        a = 1;
            }
    printf("%d/%d",r,n-2);
    return 0;
}

#include <stdio.h>
#include <math.h>

int main() {
	int a,i,sum=0;
	scanf("%d",&a);
	for(i=2;i<a;i++)
	{
		int n=a;
		while(n)
		{
			sum+=(n%i);
			n=n/i;
		}
	}
	int b=a-2;
	for(i=2;i<=b;i++)
	{
		if(sum%i==0&&b%i==0)
		{
			sum=sum/i;
			b=b/i;
		}
	}
	printf("%d/%d",sum,b);
	return 0;
}

#include<stdio.h>
int main()
{
    int i,n,a,sum=0;
    while(scanf("%d",&a)==1)
    {
        for(i=2;i<a;i++)
        {
            n=a;
            do
            {
                sum=sum+n%i;
                n=n/i;
            }while(n!=0);
        }
        printf("%d/%d\n",sum,a-2);
        sum=0;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int i,a,r,t,s,x,y;
    while(scanf("%d",&a)==1){
        x=a;
        s=0;
        for(i=2;i<=a-1;i++){
            do{
                t=a/i;
                r=a%i;
                s=s+r;
                a=t;
            }
            while(t!=0);
            a=x;
        }
        printf("%d/%d\n",s,(a-2));
    }
    return 0;
}