//
// main.c
// practice
//
// Created by Chen on 2018/6/24.
// Copyright © 2018年 Chen. All rights reserved.
//
#include <stdio.h>
#include <math.h>
int main(int argc, const char * argv[]) {
int n;
while (scanf("%d",&n)!=EOF&&n!=0) {
double i=1;
double sum=1;
while(sum<=n){
i++;
sum+=1/i;
//printf("%f\n",sum);
}
printf("%d\n",(int )i);
}
return 0;
}