#include int main(){ int N; scanf("%d",&N); int i; int cookie = 1; int cnt = 0; while (1){ if (cookie == N){ break; } for (i = cookie; i >= 1; i--){ if (cookie + i <= N){ break; } } cnt++; cookie += i; } printf("%d\n",cnt); return 0; }