#include<stdio.h>
int main()
{
int a=0;
int sum;
int b;
scanf("%d",&a);
if(a<1)
{
printf("%d\n",a);
}
else if(1<=a<10)
{
sum=2*a-1;
printf("%d\n",sum);
}
else if(a>=10)
{
b=3*a-11;
printf("%d\n",b);

}

return 0;
}