#include #include int knock(int src_num, int max_num) { int i = 0; for (i = src_num; i > 0; i--) { if(i * 2 + (src_num - i) <= max_num) { return i + src_num; } } return -1; } int main(void) { int input_num = 0; scanf("%d", &input_num); int current_num = 1; int itr = 0; while(1) { if(current_num >= input_num) { printf("%d\n", itr); break; } current_num = knock(current_num, input_num); itr++; } return 0; }