#include<stdio.h>

int main(){

    int i,j,x,count,sum,temp = 0;
    int k = 0,space,min = 999;
    scanf("%d",&x);
    for(i = 1;i < x;i++){
        temp = i;
        while(temp <= x){
            sum = temp;
            count = temp;
            //printf("temp = %d ",temp);
            space = 0;
            for(j = temp+1;space < 2;j++){
                for(k = j + space;sum < x;k++){
                    sum += k;
                    count++;
                    //printf("i = %d, sum = %d, count = %d\n",i,sum,count);
                }
                space++;
                if(min > count)
                    min = count;
            }
           
            if(sum == x)break;
            temp++;
        }
        if(sum == x)break;
    }
    //printf("%d\n",sum);
    printf("%d",min);
}
