#include<stdio.h>
struct shuju
{
char gaibian[100];
char bubian[100];
};
int main()
{ int w=1,q,n;
struct shuju zero;
void work(struct shuju one,int l);
scanf("%d",&n);
for(q=0;q<n;q++)
{ zero.gaibian[q]=w;
zero.bubian[q]=w;
w++;
}
if(n==1)
printf("1");
else work(zero,n);
}
void work(struct shuju one,int l)
{ int z,j,i,t=1,y=0;
char k;
while(1)
{ for(i=0;i<l;i++)
{ k=one.gaibian[i];
if(k!='A')
{ one.gaibian[i]=t;
if(t==3)
t=1;
else t++;
k=one.gaibian[i];
if(k%3==0)
{one.gaibian[i]='A';
y++;
if(y==(l-1))
{ for(j=0;j<l;j++)
{ if(one.gaibian[j]!='A')
{z=one.bubian[j];
goto loop;
}
}
}
}
}
}
}
loop: printf("%d",z);
}
0.0分
0 人评分