You have $$$n$$$ coins, each of the same value of $$$1$$$.Distribute them into packets such that any amount $$$x$$$ ($$$1 \leq x \leq n$$$) can be formed using some (possibly one or all) number of these packets.Each packet may only be used entirely or not used at all. No packet may be used more than once in the formation of the single $$$x$$$, however it may be reused for the formation of other $$$x$$$'s.Find the minimum number of packets in such a distribution.

The only line contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^9$$$) — the number of coins you have.

Output a single integer — the minimum possible number of packets, satisfying the condition above.

NoteIn the first example, three packets with $$$1$$$, $$$2$$$ and $$$3$$$ coins can be made to get any amount $$$x$$$ ($$$1\leq x\leq 6$$$).  To get $$$1$$$ use the packet with $$$1$$$ coin.  To get $$$2$$$ use the packet with $$$2$$$ coins.  To get $$$3$$$ use the packet with $$$3$$$ coins.  To get $$$4$$$ use packets with $$$1$$$ and $$$3$$$ coins.  To get $$$5$$$ use packets with $$$2$$$ and $$$3$$$ coins  To get $$$6$$$ use all packets. In the second example, two packets with $$$1$$$ and $$$1$$$ coins can be made to get any amount $$$x$$$ ($$$1\leq x\leq 2$$$).

#include <iostream>
#include <vector>
#define ll long long

using namespace std;

int main() {
	ll n; cin >> n;
	int i = 1; ll tmp = 2;
	while(tmp <= n) {
		tmp *= 2;
		i++;
	}
	cout << i << "\n";
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main () {
	ll n;
	cin >> n;

	ll ans=0, k=1;

	while (n>0) {
		ans++;
		n-=k;
		k*=2;
	}

	cout << ans << endl;

}

#include <iostream>

using namespace std;

int main()
{
    int n,ans=0;
    cin >> n;
    int k = 1;
    while(k<=n)
    {
        ans++;
        k*=2;
    }
    cout << ans;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(),cout.tie();
    ll n,ans=0;
    cin>>n;
    for(int i=1;n>0;i+=i){
        ans++;
        n-=i;
    }
    cout<<ans<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n,i,j,k=0;
    cin>>n;

    if((n&(n-1))==0)
    k++;

    n=ceil(log2(n))+k;

    cout<<(long long)n;
}

#include<iostream>
using namespace std;
int func(int);

int main()
{
  int n;
  cin>>n;
  cout<<func(n)<<endl;
}

int func(int n)
{
  if(n == 0) return 0;
  if(n == 1) return 1;
  if(n == 2) return 2;
  return func(n/2) + 1;
}

#include<stdio.h>
#include<math.h>

int main()
{long long int n;scanf("%I64d",&n);
for(int i=1;;i++)
if((1<<i)>n)
{printf("%d",i);break;}}

#include <bits/stdc++.h>
using namespace std;
long long  n,m,i,j,k,x;
int main(){
	scanf("%lld",&n);
	x=1;i=1;
	while (x<n){
		x*=2;
		i++;
	}
	if (x==n) cout<<i<<endl;
	    else  cout<<i-1<<endl;
   return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    int n;
    cin>>n;
    ll op=1ll*(log2(n)+1);
    cout<<op;

    return 0;
}

//In The Name of Beauty
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef map<ll,ll> mllll;
#define IB std::ios::sync_with_stdio(0);
#define pb(x) push_back(x);
#define mp(x,y) make_pair(x,y)
#define pll pair<ll,ll>
#define F first
#define S second
#define trvall(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define MAXN (ll)1e5 + 8
#define INF  (ll)1e12 + 8
ll const delta = 1000000007;

int main()
{
    IB;
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin >> n;
    ll ans = 0;
    while(n)
    {
        ans++;
        n /= 2;
    }
    cout << ans;
    return 0;
}
//Written by M_H_H_7

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,i=0;
    cin >> n;
    while(1)
    {
      i++;
      x=pow(2,i);
      if(x>n)
      {
          cout << i << endl ;
          break;
      }
    }
    return 0;
}

#include<bits/stdc++.h>
int main()
{int n;
 scanf("%d",&n);
 printf("%d\n",int(log2(n))+1);
 return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,s;
int main()
{
	cin>>n;
	for(int i=0;;i++)
	{
		s+=pow(2,i);
		if(s>=n)
		{
			cout<<i+1;
			break;
		}

	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define o2AKRXfU )
#define SN5e8jTMdl9 }
#define kjuisdfnmn int
#define KXcbdsuioWEisodufb asduyrefgdf
#define djksfuoiu cout
#define saduoiopnsdfsd djksfuoiu
#define waZ5UsI2a5w ]
#define ECLBXHaE1wcnJTQ8lwhlM [
#define ldl8kZFzzYbJI1v5X TvywQ9X6LEQ
#define XI9Zjdj4IndSo9kfeh ECLBXHaE1wcnJTQ8lwhlM
#define sdjkhfjdshf324 for
#define zQ8kn177iMP6 XI9Zjdj4IndSo9kfeh
#define jWEH5wdkwIL2DbhCh9DRnXv nRYlYOCcMbQ
#define iuasiudiaosudjbppjbnbcxhgjhjhsgdgjh eriukjjkkdjfgjhgyuyudsif
#define aEG4xFeHp5LT Gw0M7M
#define xcRQbFu HW5nBn
#define MjQWhJU2WyDQtLasvquD+eSP o2AKRXfU
#define e1EKk4nLeC4zzXb7 o2AKRXfU
#define jmsdfkWQEr22FSD234SDFFwasd ASDFasd1dfdsfsdf
#define ZPokVjqwsadLasdhjysad sdufuioiovxcmvnusd
#define ASDFasd1dfdsfsdf dsjhfucheSDFsdfsdf
#define sdfoiuin uiooqwuyyfjsdh
#define dsjfhjkiu jhdsfuyhuhbbnsdDesdF
#define asdhjsajdhubasd if
#define jhdsfuiiiuoiasdids dsjfhjkiu
#define KlopQXZvnuiuasdbbnbdsaioqw jhdsfuiiiuoiasdids
#define TvywQ9X6LEQ SN5e8jTMdl9
#define uiooqwuyyfjsdh asduiyhooXCVASwj
#define jhdsfuyhuhbbnsdDesdF ==
#define UIMNyJOKoeKNUbo {
#define D5AdvfYK2jY0V0AjaxQNKjP7zRxlwFSR2kxVkQYOMtc ldl8kZFzzYbJI1v5X
#define JDDUobOmXqpDbWPXcxt4oo44Inle c1ao3qn8KLtbB
#define uyuiuoqwMSDFiuyfdsFDS sdfoiuin
#define UHJHJdgsyduiyuiyu234r sdjkhfjdshf324
#define c1ao3qn8KLtbB Gw0M7M
#define eriukjjkkdjfgjhgyuyudsif UHJHJdgsyduiyuiyu234r
#define asduiyhooXCVASwj main
#define dsjhfucheSDFsdfsdf asdhjsajdhubasd
#define sdufuioiovxcmvnusd saduoiopnsdfsd
#define jXgZRr2cuiRXx3yGgEeJ4MHSuQ8GVOEK3SUVExK3HI e1EKk4nLeC4zzXb7
#define Gw0M7M (
#define jkpoasduihnfdsfnm kjuisdfnmn
#define asduyrefgdf jkpoasduihnfdsfnm
#define nRYlYOCcMbQ MbQxACtS3KCt
#define MbQxACtS3KCt UIMNyJOKoeKNUbo
#define HW5nBn waZ5UsI2a5w
int main JDDUobOmXqpDbWPXcxt4oo44Inle  jXgZRr2cuiRXx3yGgEeJ4MHSuQ8GVOEK3SUVExK3HI   jWEH5wdkwIL2DbhCh9DRnXv
  ios::sync_with_stdio JDDUobOmXqpDbWPXcxt4oo44Inle false jXgZRr2cuiRXx3yGgEeJ4MHSuQ8GVOEK3SUVExK3HI ;
  cin.tie JDDUobOmXqpDbWPXcxt4oo44Inle 0 jXgZRr2cuiRXx3yGgEeJ4MHSuQ8GVOEK3SUVExK3HI ;
  int n;
  cin >> n;
  int x = 1;
  int ans = 0;
  while  JDDUobOmXqpDbWPXcxt4oo44Inle n > 0 jXgZRr2cuiRXx3yGgEeJ4MHSuQ8GVOEK3SUVExK3HI   jWEH5wdkwIL2DbhCh9DRnXv
    ans++;
     jmsdfkWQEr22FSD234SDFFwasd   JDDUobOmXqpDbWPXcxt4oo44Inle n <= x jXgZRr2cuiRXx3yGgEeJ4MHSuQ8GVOEK3SUVExK3HI   jWEH5wdkwIL2DbhCh9DRnXv
      break;
     D5AdvfYK2jY0V0AjaxQNKjP7zRxlwFSR2kxVkQYOMtc
    n -= x;
    x <<= 1;
   D5AdvfYK2jY0V0AjaxQNKjP7zRxlwFSR2kxVkQYOMtc
   ZPokVjqwsadLasdhjysad  << ans << '\n';
  return 0;
 D5AdvfYK2jY0V0AjaxQNKjP7zRxlwFSR2kxVkQYOMtc

#include<iostream>
#include<algorithm>
using namespace std;

int main() {
	int n; cin >> n;
	int index=0;
	while (n>0){
	    index++;
	    n/=2;
	}
	cout << index;
}

#include <iostream>
#include <cmath>
using namespace std;
int main()
{
	int n;cin>>n;
	cout<<(int)log2(n)+1;
	return 0;
}

#include<cstdio>
//#include<algorithm>
//#include<iostream>
//using namespace std;
unsigned add=2,now=1,count=1;
unsigned read(){
	char a=getchar();unsigned res=0;
	while(a<'0'&&a>'9')a=getchar();
	while(a>='0'&&a<='9')res*=10,res+=a-'0',a=getchar();
	return res;
}
int main(){
	unsigned n=read();
	for(;;count++,n/=2){
		if(n<=now){
			printf("%u\n",count);
			return 0;
		}
	}
}

#include <cstdio>
#include <vector>
#include <algorithm>
#define pb push_back
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
const int MAXN = 1e3;
//vector<int> station;
ll a[MAXN],b[MAXN];
int main() {
    int n;
    scanf("%d", &n);
    int ans = 0;
    while (n > 0) n>>=1, ans++;
    printf("%d\n", ans);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define fastio ios_base::sync_with_stdio(false), cin.tie(nullptr)

int main()
{
	fastio;

  int n;cin >> n;

  cout << (int)log2(n)+1 << endl;

}

/**
 *    Author:  "Robin Singh" !!!
**/
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define ff first
#define ss second
#define mp make_pair
#define str string
#define szz(v) ((int)(v).size())
#define fr(i, j, k) for(int i = j; i < k; i++)     // 0 -> n-1 (i,0,n)
#define bk(i, j, k) for(int i = j-1; i >= k; i--)  // n-1 -> 0 (i,n,0)
#define frit(it, a) for(__typeof((a).begin()) it = a.begin(); it != a.end(); ++it)
#define mem(ptr)  memset(ptr, 0, sizeof ptr)  // use fill() for value other than 0
#define rtn return
#define nl "\n"      // avoid endl
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<ll, ll> > vpll;
const long long mod = 1e9+7;
const ld eps = 1e-9;
const ll INF = (1LL<<61);
const int inf = (1<<30);
//-------------------------------------------------------------------------------------------------------------
#define dbg( args...) { vector<string> _v = split( #args, ','); err( _v.begin(), args); cerr << '\n'; }
vector<string> split( const string& s, char c) { vector<string> v; stringstream ss( s); string x;
while ( getline( ss, x, c)) v.emplace_back(x); return move(v); }
void err( vector<string>::iterator it) { }
template<typename T, typename... Args>
void err( vector<string>::iterator it, T a, Args... args) {
    cerr << it -> substr( ( *it)[0] == ' ', it -> length()) << " = " << a << '\t'; err( ++it, args...); }
//-------------------------------------------------------------------------------------------------------------

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    // 1, 2, 4, 8 ... last = n-sum;

    int n;
    cin >> n;
    int sum = 1, ans = 0;
    while(n > 0){
        ans++;
        n -= sum;
        sum = sum << 1;  // sum*2
    }
    cout << ans;
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
	int x=1;
	int sum=0,ans=0;
	int n;
	cin>>n;
	while(sum<n)
	{
		sum+=x;
		ans++;
		x*=2;
	}
	cout<<ans;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n;
	scanf("%d",&n);
	int temp=1,ans,kali=1;
	while(temp<n){
		kali*=2;
		temp+=kali;
		ans++;
	}
	printf("%d\n",ans);
}

#include <bits/stdc++.h>
using namespace std;
int n,i=0;
int main()
{
	cin>>n;
	while(pow(2,i)<=n)
	i++;
	cout<<i;
}

#include<bits/stdc++.h>
using namespace std;

int main(void){
	int n;
	scanf("%d",&n);
	printf("%d\n",(int)log2(n)+1);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    int tmp = 1, res = 0;
    while (tmp <= n)
    {
        tmp *= 2; res++;
    }
    cout << res;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    scanf("%d",&n);

    int i=0;
    while((1<<i)<=n)i++;
    printf("%d\n",i);

    return 0;
}

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long long llong;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef complex <double> tc;

const int inf = int(1e9);
const double eps = 1e-9;
const double pi = 4 * atan(double(1));
ll n;
ll sum=0;
int main()
{

    cin>>n;
    int i=0;
    while(n)
      {
        n >>= 1;
        ++sum;
    }
    cout<<sum<<endl;

return 0;
}

/**
 * @jakestrj
 */

#include <fstream>
#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("-ffloat-store")
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <iomanip>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define rep(i, j, k) for(int i=(j);i<(k);++i)
#define repi(i, j, k) for(int i=(j);i<=(k);++i)
#define per(i, j, k) for(int i=(j);i>(k);--i)
#define peri(i, j, k) for(int i=(j);i>=(k);--i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).begin(),(x).end(), greater<int>()
#define mem(a, b) memset(a, (b), sizeof(a))
#define mem2(a, b) memset(a, (b), sizeof(a[0][0])*len(a)*len(a[0]))
#define sz(x) ((int)(x).size())
#define len(x) (int)(sizeof(x)/sizeof(x[0]))
#define de(x) (cout << (x) << endl)
#define endl "\n"
#define INF 1e18
#define EPS 1e-9
#define PI 2*acos(0)
#define MOD 1000000007
typedef long long ll;
typedef long double ld;
typedef tuple<int, int, int> trio;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef map<int,int> mpii;
typedef set<int> si;

struct A {
	void solve(std::istream& cin, std::ostream& cout) {
		int n; cin >> n;
		int res=0;
		while(n){
			n>>=1;
			++res;
		}
		cout << res << endl;
	}
};

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	A solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

#include<bits/stdc++.h>

#define all(v) v.begin(),v.end()
#define sc scanf
#define si(t) scanf("%d",&t)
#define sl(t) scanf("%I64d",&t)

#define sii(a,b) scanf("%d%d",&a,&b)

#define pt(a) printf("%d\n",a)
#define PLN(a) printf("%I64d\n",a)
#define pf printf

#define gcd(a,b) __gcd(a,b)
#define ff first
#define ss second

#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi acos(-1.0)
#define PI 3.1415926535897932385
#define Sin(a) sin((pi*a)/180)
#define siz 300001
#define mem(ar) memset(ar,0,sizeof ar)
#define one(x) __builtin_popcount(x)
#define mod 100000009
#define faster ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;

using namespace std;

//int dx[]= {-1,-1,0,0,1,1};
//int dy[]= {-1,0,-1,1,0,1};
//int dx[]= {0,0,1,-1};/*4 side move*/
//int dy[]= {-1,1,0,0};/*4 side move*/
//int dx[]= {1,1,0,-1,-1,-1,0,1};/*8 side move*/
//int dy[]= {0,1,1,1,0,-1,-1,-1};/*8 side move*/
//int dx[]={1,1,2,2,-1,-1,-2,-2};/*knight move*/
//int dy[]={2,-2,1,-1,2,-2,1,-1};/*knight move*/

//'A'=65,'Z'=90 'a'=97 'z'=122 '0'=48

//upper bound and lower bound

#define LB(a,value) (lower_bound(all(a),value)-a.begin())
#define UB(a,value) (upper_bound(all(a),value)-a.begin())
//S.insert(lower_bound(S.begin( ),S.end( ),x),x); //S is vector

int Set(int N,int pos)
{
    return N=N | (1<<pos);
}
int reset(int N,int pos)
{
    return N= N & ~(1<<pos);
}
bool check(int N,int pos)
{
    return (bool)(N & (1<<pos));
}
/* -a%b---------
ll  Mod(ll  a,ll  b)
{
    ll  c = a % b;
    return (c < 0) ? c + b : c;
}
/*
ll  power(ll num,ll p)
{
    int i;
    ll sum=1;
    for(i=1; i<=p; i++)
        sum*=num;
    return sum;
}
*/
int lol;
int main()
{
    faster;
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll  i,k,j,a,b,x,y,ck,t,r,ans,rem,cnt,lo,hi,sum,cs=1;
    double n;
    cin>>n;
    ans=ceil(log2(n));
    if(ceil(pow(2,ans))==n) ans++;
    cout<<ans;

}
/*
5 1
4 2 3 5 1
*/

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
int main()
{
#ifdef _DEBUG
	freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
#endif
	int n;
	cin>>n;
	int otv=1;
	int k=1;
	while(k<n)
	{
		otv++;
		n-=k;
		k*=2;
	}
	cout<<otv;
}

#include <bits/stdc++.h>
#define ll long long
#include <string>
#define PI 3.14159265
using namespace std;
int main()
{
    //freopen("input.txt", "rt", stdin);
    // freopen("output.txt", "wt", stdout);

    ll n;
    cin>>n;
    ll sum = 0,step = 0,rkm = 0;
    while(sum < n){
        rkm = sum + 1;
        sum += rkm;
        step++;
    }
    cout<<step;
    return 0;
}

#include <cstdio>
using namespace std;
int main()
{
	int i,j,n;
	scanf("%d",&n);
	for(i=1;i<=35;i++) if((1<<i)-1>=n) break;
	printf("%d\n",i);
}

#include <bits/stdc++.h>
using namespace std;
int main(){
int i,j,k,l,n;

cin>>n;

k=0;

if (n==0)cout<<0<<endl;
else if (n==1) cout<<1<<endl;
else {
k=0; l=1;
while(l<n)
{
l=l*2; k++;

}
if (l==n) k++;
cout<<k<<endl;
}

return 0;
}

#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
	int a=1;
	int b=1;
	int l,r;
	int n;cin>>n;
	for(int i=1;i<=30;i++)
	{
		if(i>1)
			b=b*2;
		a=a*2;
		l=b-1;r=a-1;
		if(l<n&&r>=n)
		{
			cout<<i;
			break;
		}
	}

	return 0;
}

#include<cstdio>
#include<cmath>
int n;
int main(){
	scanf("%d",&n);
	printf("%d",(int)log2(n)+1);
	return 0;
}

#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
typedef long long LL;
int main()
{
	LL n;
	scanf("%lld",&n);
	LL l=1,r=32;
	LL ans;
	while(l<=r)
	{
		LL mid=(l+r)/2;
		if(pow(2,mid)-1>=n)
		{
			ans=mid;
			r=mid-1;
		}
		else l=mid+1;
	}
	cout<<ans<<endl;
}

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double D;
const ll mod=1e9+7;
const int MX=3e5+9;
ll n;
int main(){
    ll ans=0,l=1;
    cin>>n;
    while(n>=l){
        n-=l;
        ans++;
        l*=2;
    }
    if(n)ans++;
    cout<<ans<<endl;
}

#include<bits/stdc++.h>

#define all(v) v.begin(),v.end()
#define sc scanf
#define si(t) scanf("%d",&t)
#define sl(t) scanf("%I64d",&t)

#define sii(a,b) scanf("%d%d",&a,&b)

#define pt(a) printf("%d\n",a)
#define PLN(a) printf("%I64d\n",a)
#define pf printf

#define gcd(a,b) __gcd(a,b)
#define ff first
#define ss second

#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi acos(-1.0)
#define PI 3.1415926535897932385
#define Sin(a) sin((pi*a)/180)
#define siz 300001
#define mem(ar) memset(ar,0,sizeof ar)
#define one(x) __builtin_popcount(x)
#define mod 100000009
#define faster ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;

using namespace std;

//int dx[]= {-1,-1,0,0,1,1};
//int dy[]= {-1,0,-1,1,0,1};
//int dx[]= {0,0,1,-1};/*4 side move*/
//int dy[]= {-1,1,0,0};/*4 side move*/
//int dx[]= {1,1,0,-1,-1,-1,0,1};/*8 side move*/
//int dy[]= {0,1,1,1,0,-1,-1,-1};/*8 side move*/
//int dx[]={1,1,2,2,-1,-1,-2,-2};/*knight move*/
//int dy[]={2,-2,1,-1,2,-2,1,-1};/*knight move*/

//'A'=65,'Z'=90 'a'=97 'z'=122 '0'=48

//upper bound and lower bound

#define LB(a,value) (lower_bound(all(a),value)-a.begin())
#define UB(a,value) (upper_bound(all(a),value)-a.begin())
//S.insert(lower_bound(S.begin( ),S.end( ),x),x); //S is vector

int Set(int N,int pos)
{
    return N=N | (1<<pos);
}
int reset(int N,int pos)
{
    return N= N & ~(1<<pos);
}
bool check(int N,int pos)
{
    return (bool)(N & (1<<pos));
}
/* -a%b---------
ll  Mod(ll  a,ll  b)
{
    ll  c = a % b;
    return (c < 0) ? c + b : c;
}
/*
ll  power(ll num,ll p)
{
    int i;
    ll sum=1;
    for(i=1; i<=p; i++)
        sum*=num;
    return sum;
}
*/
int lol;
int main()
{
    faster;
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll  i,k,j,a,b,x,y,ck,t,r,ans,rem,cnt,lo,hi,sum,cs=1;
    double n;
    cin>>n;
    ans=ceil(log2(n));
    if(pow(2,ans)==n) ans++;
    cout<<ans;

}
/*
5 1
4 2 3 5 1
*/

#include<vector>
#include<set>
#include<iostream>
#include<algorithm>
#include<map>
#include<stack>
#include<string>
#include<unordered_map>
#include<queue>
using namespace std;
typedef long long ll;
int a[200010];
int n,t, q;

int main() {
    cin>>n;
    int i = 1;
    int cnt = 1;
    int sum = 1;
    while(sum<=n){
        i*=2;
        if(n-sum!=0)
            cnt++;
        sum +=i;
    }
    cout<<cnt<<endl;
}

#include<bits/stdc++.h>
#define F(x,y,z) for (int x=y;x<=z;++x)
#define LL long long
#define ct continue
using namespace std;
int n;
int main()
{
//	freopen(".in","r",stdin);
//	#ifndef DEBUG
//	freopen(".out","w",stdout);
//	#endif
	scanf("%d",&n);
	double t=floor(log(n)/log(2));
	int tt=(int)t+1;
	printf("%d\n",tt);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll h;
int main()
{
	cin>>h;
	cout<<trunc(log2(h))+1;
	return 0;
}

#include <bits/stdc++.h>
#define pb push_back
#define sc1(n) scanf("%lld",&n)
#define sc2(a,b) scanf("%lld%lld",&a,&b)
#define sc3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define MX 100000
using namespace std;

typedef long long int ll;
typedef unsigned long long ul;

ll arr[100005];
ll cum[5001];
ll intlog(double base, double x) {
    return (ll)((ceil)(log(x) / log(base)));
}
int main()
{
    ll n;
    sc1(n);
    ll cnt=0;
    while(n!=0)
    {
        n=n/2;
        cnt++;
    }
    cout<<cnt<<endl;
    //main();
   // main();
    /*
    arr[1]=1;
    arr[2]=2;
    for(ll i=3;i<=200;i++)
    {
        arr[i]=arr[i-1]+arr[i-2]+1;
    }

    //cout<<arr[200]<<endl;

    cum[0]=0;
    for(ll i=1;i<=200;i++)
    {
        cum[i]=arr[i]+cum[i-1];
    }
    //cout<<cum[200]<<endl;
    ll n;
    sc1(n);
    ll cnt=0;
    for(ll i=1;i<=200;i++)
    {
        cnt++;
        if(cum[i]>=n)
            break;
    }
    printf("%lld\n",cnt);
    //main();
    */
}

#include<iostream>
#include<cmath>
using namespace std;
typedef long long LL;
int main()
{
	LL N; cin >> N;
	LL ans = 0;
	LL sum_total = 0;
	LL seed = 1;
	while(sum_total < N)
	{
		ans++;
		sum_total += seed;
		seed *= 2;
	}
	cout<<ans<<endl;

	return 0;
}

#include<bits/stdc++.h>
#define up(j,k,i) for(i=j;i<k;i++)
#define down(j,k,i) for(i=j;i>k;i--)
#define ipp(n) printf("%d\n",n)
#define pp(n) printf("%lld\n",n)
#define pps(n) printf("%lld ",n)
#define ipps(n) printf("%d ",n)
#define all(x) x.begin(),x.end()
#define ps(s) printf("%s",s)
#define is(n) scanf("%lld",&n)
#define iis(n) scanf("%d",&n)
#define ips(n) scanf("%lld",n)
#define ss(s) scanf("%s",s)
#define cool 0
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define f(i) cout<<i<<endl;
#define pll pair<lld,lld>
#define pi acos(-1)
#ifdef G
#define dg(x) cout<<#x<<' '<<x<<endl;
#define dg2(x,y) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<endl;
#define dg3(x,y,z) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<endl;
#define dg4(x,y,z,zz) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<' '<<#zz<<' '<<zz<<endl;
#else
#define dg(x) ;
#define dg2(x,y) ;
#define dg3(x,y,z) ;
#define dg4(x,y,z,zz) ;
#endif
#define ds(n,m) scanf("%lld %lld",&n,&m)
#define ids(n,m) scanf("%d %d",&n,&m)
#define ts(n,m,k) scanf("%lld %lld %lld",&n,&m,&k)
#define its(n,m,k) scanf("%d %d %d",&n,&m,&k)
#define yes printf("YES\n")
#define no printf("NO\n")
#define isset(num,i) ((num&(1LL<<i))!=0)
typedef long double ld;
typedef long long int lld;
using namespace std;
const lld M =2e5+10;
const lld mod=1e9+7;
const lld infi =LLONG_MAX;
lld ans,k,n,x,y,m,mymax=LLONG_MIN,mymin=LLONG_MAX,b,c,z,sum;
vector<lld> v[M];
lld find(lld n)
{
	x=0;
    y=0;
    while(x<n){
    	y++;
    	x+=y;
    }
    return y;
}
int main()
{
    lld i,j;
    lld t;

    is(n);

    lld curr=1;
    ans=0;
    while(curr<=n)
    {
    	curr*=2;
    	ans++;
    }
    pp(ans);
    //dg2(n,ans);
    //pp(ans);

    return 0;
}

#include<iostream>
#include<cmath>
using namespace std;

int n;

int change(int x)
{
	int sum=0;
	while(x)
	{
		x/=2;
		sum++;
	}
	return sum;
}

int main()
{
	while(cin>>n)
	cout<<change(n)<<endl;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main () {
    int n;
    scanf("%d", &n);
    ll pw = 1;
    int i;
    for(i = 1; pw <= n; pw <<= 1ll, i++) {

    }
    cout << i - 1 << "\n";
}

#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cstdio>
#include<stdlib.h>
#include<sstream>
#include<list>
#include<math.h>
#include<map>
#include<set>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<fstream>
#include<vector>
#include<algorithm>
#include <queue>
#include<string>
#include<cstring>
#include <deque>
#include<stack>
using namespace std;

#define ALL(a) a.begin(),a.end()
#define CLR(a) memset(a,0,sizeof(a))
#define PB push_back
#define PI acos(-1.0)
#define READ freopen("input.txt", "r", stdin)
#define WRITE freopen("output.txt", "w", stdout)
long long GCDFast(long long a, long long b) { while (b)b ^= a ^= b ^= a %= b;  return a; }
#define SET(a) memset(a,-1,sizeof(a))
#define ALL_BITS ((1 << 31) - 1)
#define NEG_BITS(mask) (mask ^= ALL_BITS)
#define TEST_BIT(mask, i) (mask & (1 << i))
#define ON_BIT(mask, i) (mask |= (1 << i))
#define OFF_BIT(mask, i) (mask &= NEG_BITS(1 << i))
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
//#define MOD 1000000007

#define MX 100010
#define pii pair<int,int>
#define LL long long

//int dx[8] = { -2,-2,2,2,1,-1, 1, 1 };
//int dy[8] = { 1, -1,1,-1,2,-2,2,-2 };//knight directions
// UP, RIGHT, DOWN, LEFT, UPPER-RIGHT, LOWER-RIGHT, LOWER-LEFT, UPPER-LEFT
//int dx[8] = { -1, 0, 1, 0, -1, 1,  1, -1 };
//int dy[8] = { 0, 1, 0,-1,  1, 1, -1, -1 };

long long GCD(long long b, long long a)//don't send b = 0
{
	if (a == 0)
		return b;
	return GCD(a, b%a);
}
long long getLCM(long long a, long long b) {
	long long c = a / GCD(a, b);
	return b * c;
}
bool sortinrev(const pair<int, int> &a,
	const pair<int, int> &b) {
	return (a.second > b.second);
}

#define N 10000002
LL length = 0;
bool prime_number[N];
int prime_num[664600];
void prime(long long n)
{
	int i = 0, limit = (long long)sqrt((double)n), x = 0, j = 0, y;

	memset(prime_number, true, sizeof(prime_number));

	for (x = 2; x <= limit; x++)
	{
		if (prime_number[x] == true)
		{
			y = n / x;
			for (i = 2; i <= y; i++)
				prime_number[i*x] = false;
		}
	}
	for (x = 2, i = 0; x < n; x++)
		if (prime_number[x])
		{
			prime_num[i] = x;
			i++;
		}
	length = i;
}

LL MOD = 1e9 + 7;
//2^p%m
LL bigmod(LL b, LL p, LL m) {
	LL ans = 1;

	while (p) {
		if (p & 1) {
			ans *= b;
			ans %= m;
		}
		b = ((b*b) % m);
		p /= 2;
	}

	return ans;
}
LL a[200005], b[200005];

int main() {
	//	freopen ("d:/Codejam/input.txt","r",stdin);
	//	freopen ("d:/Codejam/output.txt","w",stdout);
	LL n, i, j, k, temp, p, q;
	LL x, y, z, sum, test_case = 0, ans, test, l, r, m;
	string str;
	bool flag = true;
	ios_base::sync_with_stdio(false);

	//prime(400000);
	//cout << length;
	while (cin >> n) {
		ans = 0;
		x = 1;
		while (n > 0) {
			ans++;

			if (n < x) {
				break;
			}
			n -= x;
			x = x << 1;
			//cout << x << "\n";
		}
		cout << ans << endl;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define INF 1e9

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    ll n;
    cin >> n;

    ll ans = 1;
    ll i = 1;
    ll buf = n;
    while (i <= n/2) {
        i *= 2;
        ans++;
    }
    cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
string binary(long long x)
{
    string s;
    while(x)
    {
        if(x%2==0) s='0'+s;
        else s='1'+s;
        x/=2;
    }
    return s;
}
int main()
{
    ll n; cin>>n;
    string s=binary(n);
    cout<<s.size();
}

#include<cstdio>
#include<cmath>

typedef long long ll;

int n,ans;

int main(){
    scanf("%d",&n);
    while(n){
        ans++;
        n>>=1;
    }
    printf("%d",ans);
}

// Devarshi

#include<bits/stdc++.h>

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

const int maxn=1000001;

int main(){

int n;
cin>>n;
int cnt=0;
while(n){
    n>>=1;
    cnt++;
}
cout<<cnt;

return 0;
}

 #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
	int n,k;
	scanf("%d",&n);
	k=log2 (n)+1;
	printf("%d",k);
	return 0;
}

#include <bits/stdc++.h>
#define mem(i,a) memset(i,a,sizeof(i))
#define PI acos(-1.0)
#define DMAX 1000000005     //数组大小
#define MOD 19260817     //模数
#define eps 1e-8
#define bl bool
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
template<class T> inline void read(T &f){
	f=0;
    T x=1;
    char ch=getchar();
    while(ch<48 || ch>57) {
        if(ch=='-') {
            x=-1;
        }
        ch=getchar();
    }
    while(ch<=57 && ch>=48) {
        f=f*10+ch-'0';
        ch=getchar();
    }
    f*=x;
}
int main(){
	ll n;
	read(n);
	cout<<floor(log2(n)+1)<<endl;
	return 0;
}

#pragma GCC optimize(2)
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n;
	cin>>n;
	cout<<(int)(log2(n))+1;
	return 0;
}

// Author: πα

#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define long long long

int main()
{
    IOS;
    long n;
    cin >> n;
    int x = floor(log2(n));
    cout << x + 1;
    return 0;
}

#include <stdio.h>

void solve(){
	int n;
	scanf("%d",&n);
	int ans=0;
	while(n){
		n>>=1;
		ans++;
	}
	printf("%d\n",ans);
}

int main(){
	solve();
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ios_base::sync_with_stdio(false);
	ll n;
	cin>>n;
	long long k=0;
	while(pow(2,k)<=n)
		k++;
	cout<<k;
}

#include <bits/stdc++.h>

int main()
{
	int n;
	scanf("%d", &n);
	int sum = 1, cnt = 1, ans = 1;
	while(sum < n)
	{
		cnt <<= 1;
		sum += cnt;
		ans ++;
	}
	printf("%d", ans);
}

#include <cstdio>
int n,t;
int main() {
	scanf("%d",&n);
	while(n)t++,n>>=1;
	printf("%d",t);
	return 0;
}

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin>>n;
    cout<<(int)log2(n)+1;
    return 0;
}//by tryrtj

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int n;
void init(){
    scanf("%d",&n);
    int ans=log2(n)+1;
    printf("%d",ans);
}
int main(){
    init();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
    int n; cin >> n;
    for (int i = 30;i >= 0; i--) {
        //cout << i << ' ' << (1 << i) << endl;
        if ((1 << i) & n) {
            cout << i + 1 << endl;
            break;
        }
    }
    return 0;
    cout << 32 - __builtin_clz(n) << endl;
    return 0;
}

#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
using namespace std;
int main()
{
	int i, j, k, m, n, a[10004], x, y, sum = 0;
	char s[10000];
	pair <int, int > p[10004];
	double d, w;
/*
	cout << fixed;
	cout.precision(12);
	cout << k << endl;
*/
	cin >> n;
	/*for (i = 0; i < n; i++)
		cin >> a[i];
*/
	sum = 0;
	k = 1;
	while (k<=n)
	{
		k *= 2;
		sum++;
		if (k > n)
		{
			cout << sum << endl;
			break;
		}
	}

//	system("pause");
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#define ll long long
#define sqr(x) x * x
#define forn( i, n) for (int i = 0; i < (int)n; ++i)
#define all(i) i.begin(), i.end()
#include <stdio.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <queue>
#include <ctime>
#include <map>
#include <set>
#include <random>
#include<iomanip>
#include<future>
template<typename T>
inline  T abs(const T& a)
{
	return a < 0 ? -a : a;
}
using namespace std;
void boost()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
}
void spr(int x) { cout << setprecision(x) << fixed; }

int main()
{
	boost();
	long long x;
	cin >> x;
	long long c = 1, ans = 0;
	while (c <= x)
	{
		x -= c;
		c *= 2;
		ans++;
	}
	if (x != 0) ans++;
	cout << ans;
}

#include <bits/stdc++.h>

#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define debug1(a) cout<<a<<"\n";
#define debug3(a,b,c) cout<<a<<" "<<b<<" "<<c<<"\n";
#define debug2(a,b) cout<<a<<" "<<b<<"\n";
#define debug4(a,b,c,d) cout<<a<<" "<< b <<" "<<c<<" "<<d<<"\n";

ll mod = 1000000007;

using namespace std;

int main()
{
	#ifndef ONLINE_JUDGE
	 freopen("input.txt", "r", stdin);
	 freopen("output.txt", "w", stdout);
	#endif
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

	ll n;
	cin>>n;

	if(n ==1)
	{
		cout<<1<<"\n";
		return 0;

	}
	else if(n == 2) {
		cout<<2<<"\n";
		return 0;
	}

	ll i =1;
	int a = log2(n)/log2(2);
	int b = log(n)/log(2);
	//cout<<log(n)<<endl;
	a++;
	cout<<a<<"\n";

	return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define F first
#define S second

using namespace std;
const ll maxn = 1e5+10 , inf = 1e7+10;

int c[30];

int main()
{
    ll n , t=0;
    cin >> n;
    while ((1<<t)<=n)t++;
    cout << t;
}

#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,a,n) for(int i=a;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define pb push_back
#define mp make_pair
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef vector<ll>		vi;
typedef vector<pii>		vpii;
typedef vector<vi>		vvi;
const ll maxn = 1e5+6 ;
const ll MOD = 1e9 + 7  ;
 int prim[100001] ;
 int fact[maxn] ;

 bool isVowel(char ch) {

    if(ch == 'a' || ch == 'i' || ch == 'e' || ch == 'u' || ch == 'o' || ch == 'y'){
        return true;
    }
    return false;
}
ll power(ll x, ll i,ll mod)
{
	ll ans = 1;
	while(i > 0)
	{
		if(i&1)
			ans = (ans*x)%mod;
		i >>=1;
		x = (x*x)%mod;
	}
	return ans;
}

ll modInverse(ll x, ll mod)
{
	return power(x , mod-2,mod);
}
int nCr (int n , int r) {
    if(n < r) {
        return 0;
    }
    return ( ( ( fact[n] * modInverse(fact[n-r], MOD) ) % MOD ) * modInverse(fact[r],MOD) ) % MOD;
}

void erath() {
    int n = 100000 ;
    for(int i=1 ; i<=n ; i++){
        prim[i] = 1 ;
    }
    prim[1] = 0 ;
    prim[0] = 0 ;prim[2] = 1 ;
    for(int i=2 ; i*i<=n ; i++){
        if(prim[i]){
        for(int j=i*i ; j <=n ; j+=i){
            prim[j] = 0 ;
         }
        }
    }

   }
 void dfs(int k , int tar ,bool& ok){
      if(k>tar){
        return ;
      }
     // cout<<k<<" "<<tar<<endl;
      if(k==tar){
        ok = 1 ;
        return ;
      }
      dfs(2*k , tar , ok) ;
      dfs(10*k+1 , tar , ok) ;
  }
  int genh(string s){
     int ans = 0 ;
     for(int i=0 ; i<s.size() ; i++){
        ans+=(i+1)*int(s[i]) ;
     }
     return ans ;
  }
 int gcd( int a, int b)
{
  if (b == 0)
    return a;
  return gcd(b, a % b);
}

// Function to return LCM of two numbers
int lcm(int a, int b)
{
    return (a / gcd(a, b)) * b;
}

void ans() {
   ll n ; cin>>n;
   int ans = 0 ;
   if(n==1) {cout<<1<<endl;return;}
   if(n==2) {cout<<2<<endl;return;} bool  f = 0 ;
   while(n > 0){

      if(n==2 && f){
        ans+=1 ;
        n = 0 ;
        break ;
      }else if(n==2 && f==0){
        ans+=2 ;
        n = 0 ;
        break ;
      }
      else if(n==3){
        ans+=2 ;
        n = 0 ;
      }
      else {
         ans++ ;
         if(n & 1 && (n>1)) {n++ ; f = 1 ; }
         n/=2 ;
       }
   }
   cout<<ans<<endl;
}
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

   int t = 1;

  // cin >> t;
    while(t--) {
      ans();
    }

    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <cstdio>
#include <cmath>
#include <set>
using namespace std;
int main() {
	int n,k = 1,ans = 0;
	cin >> n;
	while (n > 0)
	{
		n -= k;
		ans++;
		k *= 2;
	}
	cout << ans;
	//system("pause");
}

#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+3;
#define LL long long
int main(){
	LL n;
	while(scanf("%I64d", &n) != EOF){
		LL ans = 0;
		while(n){
			n>>=1;
			ans++;
		}
		printf("%I64d\n", ans);
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    int n;
    cin>>n;
    ll op=1ll*(log2(n)+1);
    cout<<op;

    return 0;
}

#include<cstdio>
#include<cmath>
int n;
int main(){
	scanf("%d",&n);
	printf("%d",(int)log2(n)+1);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
long long x, n;
int main()
{
    //freopen("test.inp", "r", stdin);
  //  freopen("test.out", "w", stdout);
    cin>>n;
    if (n==1)
    {
        cout<<1;
    }
    else
    {
       for (int i=30; i>=1; i--)
       {
           x = pow(2, i);
          // cout<<x<<endl;
           if (n>=x)
           {
               cout<<i+1;
               exit(0);
           }
       }
    }

}

#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

int main()
{
	int N;scanf("%d",&N);
	int ans = log2(N);
	printf("%d\n",ans + 1);
	return 0;
}

#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
typedef long long LL;
const int maxn=1e5+5;
int main()
{
    LL n;
    scanf("%I64d",&n);
    int ans=0;
    while(n)
    {
        n>>=1;
        ans++;
    }
    printf("%d\n",ans);
    return 0;
}

// MY CODE

#include <bits/stdc++.h>
#define ll long long
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define loop(i, start, end) for( ll i = start; i < end; i++)
using namespace std;

ll arr[200001];

int main() {
   fastio();
   int n;
   cin >> n;
   int cnt = 0;
   while(n > 0){
    n/=2;
    cnt++;
   }
   cout << cnt << "\n";
   return 0;
}

#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main()
{
long long n;
cin>>n;
double x=log10(n)/log10(2) ;
cout<<floor(x+1);
}

#include <iostream>

int main()
{
    int n;
    std::cin >> n;
    int num_comb = 1, count = 0;
    while(n)
    {
        n >>= 1;
        count++;
    }
    std::cout << count;
    return 0;
}

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#define pb push_back
#define ll long long
#define inf 0x3f3f3f3f
#define fill(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(b))
template<typename T> inline bool MIN(T &a,const T &b) {return a>b? a=b,1:0;}
template<typename T> inline bool MAX(T &a,const T &b) {return a<b? a=b,1:0;}
#define mod 1000000007
inline int plu(int a,int b) {return a+b>=mod? a+b-mod:a+b;}
inline int sub(int a,int b) {return a-b<0? a-b+mod:a-b;}
inline int mul(int a,int b) {return (ll)a*b%mod;}
inline int inc(int &a,int b) {a+=b;if (a>=mod) a-=mod;}
inline int dec(int &a,int b) {a-=b;if (a<0) a+=mod;}
#define mp make_pair
#define sz(a) ((int)a.size())
#define bk(a) (a[sz(a)-1])
#define fi first
#define se second
#define N
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
int P(int a) {printf("%d\n", a);} int P(int a, int b) {printf("%d %d\n", a, b);} int P(int a, int b, int c) {printf("%d %d %d\n", a, b, c);} int P(int a, int b, int c, int d) {printf("%d %d %d %d\n", a, b, c, d);} int P(int a, int b, int c, int d, int e) {printf("%d %d %d %d %d\n", a, b, c, d, e);}

int n;

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
#endif
    cin >> n;
    if (n == 1) {
        cout << 1;
        return 0;
    }
    int sum = 0;
    int ans = 0;
    for (int i = 1; i <=n; ) {
        int a = min(i, n - sum);
        // P(a, 0);
        ans++;
        sum += a;
        i = sum + 1;
    }
    cout << ans;
    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
long long n,ans;
bool flag=true;
int main()
{
	cin>>n;
	for(int i=0;i<=40;i++)
	{
		if((1<<i)>n)
		break;
		n-=1<<i;
		if(n==0) flag=false;
		ans++;
	}
	if(flag==true)cout<<ans+1<<endl;
	else cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output1.txt", "w", stdout);
    #endif
    int n;
    cin >> n;
    int k=log2(n)+1;
    cout<<k;

	return 0;
}

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
	int n;
	scanf("%d",&n);
	printf("%d\n",(int)log2(n)+1);
	return 0;
}

#include<iostream>
using namespace std;
typedef long long LL;
LL n, ans;
int main(){
	cin >> n;
	while(n){
		n /= 2;
		ans++;
	}
	if(n <1000)cout << ans << endl;
	else cout << 0 << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define    ll    long long int
#define    db    double
#define    ch    char
#define    st    string
#define    lp1   for(i=1;i<=n;i++)
#define    lp2   for(j=1;j<=n;j++)
#define    wl    while(t--)
#define    yes   cout<<"YES"<<endl;
#define    no    cout<<"NO"<<endl;
//cout<<"Case "<<j++<<": "<<n*(n*n+1)/2<<endl;
ll n,m,t,i,j,k,c=0,x,y,z,d=0,g,h,a,b,e,f;
st s,p="";ch q;set<ll> s1,s2;vector<ll> v,w;
int main()
{
    cin>>n;
    c=0,k=1;
    while(1){
        if(n>0) c++;
        else break;
        n-=k;
        k*=2;
    }
    cout<<c;
}

#include<cstdio>
#include<cstring>
#include<queue>
#include<stack>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n;

int main()
{
    ll x;
    scanf("%lld",&x);
    ll ans = 1;
    for(ll i = 1;i<=x;i++)
    {
        if(ans<=x&&x<ans*2)
        {
            printf("%lld\n",i);
            break;
        }
        ans*=2;
    }
    return 0;
}

#include <bits/stdc++.h>

#define ll long long int
#define ii int
#define F first
#define S second
#define FOR(i , begin , step , end) for(ll i = begin ; i <= end ; i+=step)
#define LOOP(i , begin , step , end , arr) for(ll i = begin ; i <= end ; i+=step) { cout << arr[i] << " "; } cout << endl;
#define lengall(s) s.size()
#define see(a) cout << a << endl;
#define debug(a) cout << (#a) << " = " << a << "\n";
#define line(a) cout << a << " " ;
#define space(a , b) cout << a << " " << b << endl;
#define REN(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define MAXX 1000007

using namespace std;

ll csc(ll i){
    return (i * (i + 1) >> 1);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    /**
        hello Huy
    **/

    ll n;
    cin >> n;

    ll i = 0;

    while(n != 0){
        n >>= 1;
        i++;
    }
    see(i)
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

int main(){
	int n, ans = 0;
	scanf("%d", &n);
	while(n){
		int tmp = n/2;
		if(n%2 == 0)
			n -= tmp;
		else
			n -= (tmp+1);
		if(n>=0)
			ans++;
	}
	printf("%d\n", ans);
return 0;
}

#include"bits/stdc++.h"
using namespace std ;

int main()
{
    int N;

    cin>>N;

    int cnt=0;

    while(N>0)
    {
        N/=2;
        cnt++;
    }

    cout<<cnt<<"\n";

    return 0;
}

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Apolloliu
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

using namespace std;

void get() {

}
typedef long long ll;
class APackets {
public:
	void solve(std::istream& in, std::ostream& out) {
		int n;
		in >> n;
		int res = 0;
		if(n == 1 || n == 2){
			out << n << '\n';
			return;
		}
		int i = 1, j = 2, t = 2;
		while (res < n){
			res = i + j;
			if(res >= n)break;
			i = res; j = res+1;
			t++;
		}

		out << t<< endl;
	}
};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	APackets solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    cout<<(int)log2(n)+1;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	ll n;int i;
	cin>>n;
	int p=ceil(log(n)/log(2));
	for(i=0;i<p;i++){
		n=n-(ll)(pow(2,i));
	}
	if(n>0)
		p++;
	cout<<p<<endl;
}

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
const ll init = 1e9+7;

#define mkp make_pair
#define pb push_back
#define pq priority_queue
#define minpq priority_queue <int, vector<int>, greater<int> >
#define vi vector <int>
#define vll vector <ll>
#define pii pair<int,int>

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin>>n;
	int ans=0;
	while(n){
		++ans; n/=2;
	}
	cout<<ans<<endl;
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
#include <string>
#define PI 3.14159265
using namespace std;
int main()
{
    //freopen("input.txt", "rt", stdin);
    // freopen("output.txt", "wt", stdout);

    ll n;
    cin>>n;
    ll sum = 0,step = 0,rkm = 0;
    while(sum < n){
        rkm = sum + 1;
        sum += rkm;
        step++;
    }
    cout<<step;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll n;
	cin>>n;
	ll k=0;
	while(pow(2,k)<=n)
		k++;
	cout<<k<<endl;
}

#include<cstdio>
using namespace std;
inline int read()
{
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')s=s*10+(ch-'0'),ch=getchar();
	return s*w;
}
int n,ans;
int main()
{
	n=read();
	while(n) n/=2,ans++;
	printf("%d\n",ans);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define optimize ios_base::sync_with_stdio(false)
#define FOR(i, a, n) for(int i = a; i <= n; i++)
int myArray[100009], cur_marks[100009], t;
long long ans, n;

int main()
{
    optimize;

    //freopen("input.txt", "r", stdin);
    cin >> n;
    int i;
    for(i = 0, t = 1; n > 0; i++, t = t << 1){
        n -= t;
    }
    cout << i << "\n";

    return 0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;
const int maxn=1e5+10;
int n,pos,cnt;

int main(){
	scanf("%d",&n);
	cnt=0,pos=1;
	while(n>0){
		cnt++;
		if(n<=pos) break;
		n-=pos;
		pos=pos*2;
	}
	printf("%d\n",cnt);
	return 0;
}

#include<bits/stdc++.h>

#define MAX_N 0 /*update every time*/
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())

using namespace std;

typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
typedef long long ll;

int n;

int main(int argc, char const *argv[]) {
  #ifndef ONLINE_JUDGE
  freopen("input.in", "r", stdin);
  freopen("output.out", "w", stdout);
  #endif
  scanf("%d",&n);
  int c=1;
  int i=1;
  int sum=0;
  while(i<=n){
  	sum+=i;
  	if(sum<=n){
  		c++;
  		break;
  	}
  	i++;
  }
  if(sum>n)
  	c++;
  printf("%d\n",c);
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int n;
    cin>>n;
    long long sum=0,cnt=0;
    for(long long int i=1;sum<=n;i++)
    {
        sum=sum+i;
        cnt++;
    }
    cout<<cnt<<endl;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
inline int read(){
    int x=0,c=getchar(),f=0;
    for(;c>'9'||c<'0';f=c=='-',c=getchar());
    for(;c>='0'&&c<='9';c=getchar())
    x=(x<<1)+(x<<3)+c-'0';return f?-x:x;
}
const int inf = 1e9 + 7;
const int maxn = 2e5 + 10;

int a[maxn];
int main (){
    a[0] = 0;
    int k = 0;
    for (int i=1; ; i++){
        a[i] = a[i-1] + i;
        if (a[i] > inf){
            k = i;
            break;
        }
    }

    int n;
    while (~scanf("%d", &n)){
        int id = lower_bound(a, a+k+1, n) - a;
        cout << id << endl;
    }
    return 0 ;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n;
	long long int i;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		if(i*(i+1)/2>=2*n && i*(i-1)/2<n)
		{
			cout<<i;
			break;
		}
	}
	return 0;
}

#include<bits/stdc++.h>
#define up(j,k,i) for(i=j;i<k;i++)
#define down(j,k,i) for(i=j;i>k;i--)
#define ipp(n) printf("%d\n",n)
#define pp(n) printf("%lld\n",n)
#define pps(n) printf("%lld ",n)
#define ipps(n) printf("%d ",n)
#define all(x) x.begin(),x.end()
#define ps(s) printf("%s",s)
#define is(n) scanf("%lld",&n)
#define iis(n) scanf("%d",&n)
#define ips(n) scanf("%lld",n)
#define ss(s) scanf("%s",s)
#define cool 0
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define f(i) cout<<i<<endl;
#define pll pair<lld,lld>
#define pi acos(-1)
#ifdef G
#define dg(x) cout<<#x<<' '<<x<<endl;
#define dg2(x,y) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<endl;
#define dg3(x,y,z) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<endl;
#define dg4(x,y,z,zz) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<' '<<#zz<<' '<<zz<<endl;
#else
#define dg(x) ;
#define dg2(x,y) ;
#define dg3(x,y,z) ;
#define dg4(x,y,z,zz) ;
#endif
#define ds(n,m) scanf("%lld %lld",&n,&m)
#define ids(n,m) scanf("%d %d",&n,&m)
#define ts(n,m,k) scanf("%lld %lld %lld",&n,&m,&k)
#define its(n,m,k) scanf("%d %d %d",&n,&m,&k)
#define yes printf("YES\n")
#define no printf("NO\n")
#define isset(num,i) ((num&(1LL<<i))!=0)
typedef long double ld;
typedef long long int lld;
using namespace std;
const lld M =2e5+10;
const lld mod=1e9+7;
const lld infi =LLONG_MAX;
lld ans,k,n,x,y,m,mymax=LLONG_MIN,mymin=LLONG_MAX,b,c,z,sum;
vector<lld> v[M];
lld find(lld n)
{
	x=0;
    y=0;
    while(x<n){
    	y++;
    	x+=y;
    }
    return y;
}
int main()
{
    lld i,j;
    lld t;
    is(t);
    while(t--)
    {

    n=t;
    //is(n);
    ans=1+find((n)/2);
    //dg2(n,ans);
    pp(ans);
    }

    return 0;
}

#include <bits/stdc++.h>

using namespace std;
long long  n , i;
long long sum;
int main()
{
      cin >> n;
      for (i = 1;sum < n; i++)
      {
            if (sum + i < n) sum += i;
            else break;
      }
      cout << i;
}

#include <bits/stdc++.h>

using namespace std;
int main()
{ int long long a;
cin>>a;
if( a>=7)
{
if(a%2==0)
    {
        cout<<(a/2);
    }
    else
    {
        cout<<(a/2)+1;
    }
}
else
{
    cout<<a/2;
}
return 0;
}

#include <string>
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

const int DIM = -1;
int n;
string t;
int main() {

	cin >> n >> t;

	for (int i = 1; i <= n; ++i)
	{
		if (n % i == 0)
		{
			reverse(t.begin(), t.begin() + i);
		}
	}

	cout << t;
	//getchar();
	//getchar();
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

typedef long long LL;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=b-1;i>=a;i--)

int main(){
	int x;
	while(scanf("%d",&x)==1){
		int ans=0;
		for(int i=1;i<=60;i++){
		    if(x>=(1LL<<i))x-=(1LL<<i),ans++;
		    else break;
		}
		if(x)ans++;
		printf("%d\n",ans);
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int n, res;

int main() {
    cin >> n;
    while (1LL * res * (res + 1) / 2 <= 1LL * n) {
        res++;
    }
    cout << res - 1 + ((n - res * (res + 1) / 2) > 0);
}

#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
using namespace std;

void solve(){
	int n;
	cin>>n;
	cout<<ceil(sqrt(2*n+0.25)-0.5)<<endl;
}

int main(){
	solve();
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int cnt1( int high)
{
    // Initialize first three Fibonacci Numbers
    int f1 = 0, f2 = 1, f3 = 1;

    // Count fibonacci numbers in given range
    int result = 0;
 long long int sum=1;
    while (f3 <= high&&sum<high)
    {
           result++;
        f1 = f2;
        f2 = f3;
        f3 = f1 + f2;
        sum+=f3;
    }
    if(sum>=high){
        result++;
    }

    return result;
}
typedef long long int ll;
int main(){
    ll n;
    cin>>n;
    int cnt=cnt1(n);
    cout<<cnt<<endl;
}

#include <bits/stdc++.h>
using namespace std; int main(){ int n,out=0;cin>>n;for(int i=1;i<=n;i++)out=max(out,__builtin_popcount(i));cout<<out+1; }

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define N 1e9+5
int main(){
    int n; cin >> n;
    if(n == 1) return cout << 1, 0;
    for(int i = 2, j = 1, cnt = 2 ; ; i += j+1, j += 2, cnt++)
        if(n >= i && n <= i + j)
            return cout << cnt, 0;
}

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef double db;

#define mp make_pair
#define pb push_back
#define pt(i) printf("%lld\n",(ll)i)
#define mp make_pair
#define ff first
#define ss second
#define pi acos(-1.0)

ll in() { ll a;scanf("%lld",&a); return a;}
db din(){ db a;scanf("%lf",&a); return a; }
ll bigmod(ll b, ll p,ll md){if(p==0) return 1;if(p%2==1){ return ((b%md)*bigmod(b,p-1,md))%md;} else {ll y=bigmod(b,p/2,md);return (y*y)%md;}}
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b);}

int main()
{
    ll n=in();
    for(ll i=1;;i++)
    {
        ll x=(i*(i+1))/2;
        x=2*x+1;
        if(x>=n)
        {
            pt(i+1);
            return 0;
        }
    }
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<algorithm>
#include<cmath>
#include<queue>
#define R register
#define II int
#define fo(i,a,b) for(R II i=(a);i<(b);++i)
#define FO(i,a,b) for(R II i=(a);i<=(b);++i)
#define fg(i,x) for(R II i=head[x];i;i=ed[i].nt)
#define mmt(a,b) memset(a,b,sizeof(a))
#define OP operator
#define CT const
#define IL inline
#define ls(x) (x<<1)
#define rs(x) (ls(x)|1)
#define isd(x) ('0'<=x&&x<='9')
#define inf 0x7ffffff
using namespace std;
typedef long long ll;
typedef unsigned long long lol;
class fast_ioput{
private:
    #define num(ch) (ch-'0')
public:
    template<class T>fast_ioput& operator >> (T &res) {
        char ch;bool flag=0;
        while(!isdigit(ch=getchar()))
        (ch=='-')&&(flag=true);
        for(res=num(ch);isdigit(ch=getchar());res=res*10+num(ch));
        (flag)&&(res=-res);
        return *this;
    }
    template<class T>fast_ioput& operator <<(T a){
        if(a<0){putchar('-');a=-a;}
        if(a>9)*this << (a/10);
        putchar(a%10+'0');
        return *this;
    }
    fast_ioput& OP << (fast_ioput& (*op)(fast_ioput&)){
        return (*op)(*this);
    }
}io;
IL fast_ioput& endl(fast_ioput& str){
    putchar('\n');
    fflush(stdout);
    return str;
}
int n;
int cnt=0,ans[50];
int main()
{

    scanf("%d", &n);
    while(n)
    {
        ans[++cnt]=n>>1;
        if(n&1) ans[cnt]++;
        n>>=1;
    }
    printf("%d\n",cnt);
    for (int i=cnt;i>=1;i--)
    printf("%d ",ans[i]);
    /*for(int i = 0; ; i++) if((1<<i) > n)
    {

        printf("%d\n", i);
        break;
    }*/
    /*for(printf("%d\n",temp+1); temp; temp--)
    {
    printf("%d ",ans[temp]);
    cout<<" ";
    }*/
    return 0;
}

#include<bits/stdc++.h>

#define MAX_N 0 /*update every time*/
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())

using namespace std;

typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
typedef long long ll;

ll n;

int main(int argc, char const *argv[]) {
  #ifndef ONLINE_JUDGE
  freopen("input.in", "r", stdin);
  freopen("output.out", "w", stdout);
  #endif
  scanf("%lld",&n);
  int c=0;
  ll i=1;
  while(i*(i+1)/2<=n){
  	i++;
  }
  i--;
  if(i*(i+1)/2<n)
  	i++;
  printf("%lld\n",i);
  return 0;
}

/*
"IF U BELIEVE WHY NOT!!"
                       --Cristiano Ronaldo
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define M 1000000007
#define INF 1000000007
typedef pair<lli,lli> ll;
#define mem(a,x) memset(a,x,sizeof(a))
lli n,k,m;
lli dist[507][507];
lli path1[207][207];
vector<int> v2(1005,1);
vector<double> v;
lli x,y,c,z,t,q,u,d,a1,b;
struct edge
{
    lli a,b,cost;
};
/*void djkstra(int x,vector<ll> v[])
{
    mem(vis,0);
    dist[x]=0;
    s2.insert({0,x});
    while(!s2.empty())
    {
        ll p=*s2.begin();
        s2.erase(s2.begin());
        x=p.second;
        if(vis[x])
        continue;
        vis[x]=1;
        for(int j=0;j<v[x].size();j++)
        {
            if(dist[v[x][j].second]>dist[x]+v[x][j].first)
            {
                dist[v[x][j].second]=dist[x]+v[x][j].first;
                s2.insert({dist[v[x][j].second],v[x][j].second});
                a[v[x][j].second]=x;
            }
        }
    }
}*/
lli parent[100007];
lli find(lli a)
{
    return a==parent[a]?a:parent[a]=find(parent[a]);
}
void dset(lli n)
{
    for(int j=0;j<=n;j++)
    parent[j]=j;
}
void unio(lli a,lli b,lli rank[])
{
    if(rank[find(a)]>rank[find(b)])
    parent[find(b)]=find(a);
    else if(rank[find(b)]>rank[find(a)])
    parent[find(a)]=find(b);
    else
    {
        parent[find(a)]=find(b);
        rank[find(b)]++;
    }
}
bool check(lli a)
{
    if((a1*a*m+b*(a-1)+d)>=x)
    return true;
    return false;
}
/*bool valid(int i,int x)
{
    for(int j=1;j<x;j++)
    {
        if((abs(b[j-1]-i)==abs(j-x))||(i==b[j-1])||(j==x))
        return false;
    }
    return true;
}*/
lli p[10007];
lli dp[301][301][301];
map<ll,ll> pat;
map<ll,lli> p2;
lli pr[200007],we[200007];
lli a[100005];
map<lli,lli> m4;
vector<int> v4;
int f=0;
lli tot=1;
lli vis[1001][1001];
lli p1;
lli s[10001];
lli n1;
lli me(lli a,lli b,lli m)
{
    if(b==0)
    return 1;
    else if(b%2==0)
    return me((a*a)%m,b/2,m);
    else
    return (a*me((a*a)%m,(b-1)/2,m))%m;
}
int main()
{
cin>>n;
int i;
for(i=1;i<=n;i++)
{
    if((i*(i+1))>=2*n)
    break;
}
lli s[i+1];
lli s1[i+1];
mem(s,0);
mem(s1,0);
for(int j=1;j<=i;j++)
{
    if(j==1)
    s[j]=1;
    else
    s[j]=s[j-1]+j;
}
for(int j=i;j>=1;j--)
{
    if(j==i)
    s1[i-j+1]=j;
    else
    s1[i-j+1]=s1[i-j]+j;
}
int c=i;
for(int j=i-1;j>=1;j--)
{
    if(s1[i-j+1]<=s[j-1])
    {
       c--;
    }
}
cout<<c;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,x=0,i=1;
    cin >> n;

    while(x < n)
    {
        x=(i*(i+1))/2;
        i++ ;
    }
    cout << (i-1) << endl;
    return 0;
}

#include <bits/stdc++.h>

#define rep(i,n,s)		for(i=s;i<n;i++)
#define repr(i,n,s)		for(i=s;i>=n;i--)
#define remax(x,y)		x = max(x,(y))
#define remin(x,y)		x = min(x,(y))
#define all(c)			(c).begin(),(c).end()
#define allr(c)         (c).rbegin(),(c).rend()
#define loop(c,i)       for(typeof(c.begin()) i = c.begin(); i != c.end(); i++)
#define loopr(c,i)      for(typeof(c.end()) i = c.end(); i != c.begin(); )
#define ll long long
#define ittr(v) typeof(v)::iterator

#define pb	push_back
#define mp 	make_pair
#define vi 	vector<int>
#define vl 	vector<long>
#define vpii 	vector< pair<int,int> >
#define vpil 	vector< pair<int,long> >
#define vpll 	vector< pair<long,long> >

#define pii 	pair<int,int>
#define piii	pair< pair<int,int>,int >
#define pll 	pair<long,long>
#define plll 	pair< pair<long,long>,long >

#define umii 	map<int,int>

#define F first
#define S second
#define MOD 1000000007
using namespace std;

int main()
{
	int n;
	cin>>n;
	float ans = (float)(-1 + sqrt(1+ 8*n) )/(float)2 ;

	cout << ceil(ans)<<endl;

}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    scanf("%d",&n);

    int cnt = 1;
    int i = 2;
    while(cnt < n)
    {
        cnt += i;
        i++;
    }
    i--;

    printf("%d\n",i);

    return 0;
}

#include <bits/stdc++.h>
#define endl '\n'
#define debug( x ) cout << #x << " = " <<  x << endl;
#define F first
#define S second
#define PB push_back
#define size( x )   int( ( x ).size( ) )
#define endl '\n'
#define rep(i, a, b) for( __typeof(a) i =(a); i<(b);i++)

using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;

int main(){
#ifdef LOCAL
  freopen("in", "r" , stdin);
#endif
 ll n;
 cin >> n;
 ll res = 0, i;
 for ( i = 1; i <= n+1; i++){
   res += i;
   if( res > n ){
     res -= i;
     i--;
     break;
   }
 }
 if( res != n) i++;
 cout << ( i ) <<endl;
 return 0;
}

#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
using namespace std;
int main()
{
	int i, j, k, m, n, a[10004], x, y, sum = 0;
	char s[10000];
	pair <int, int > p[10004];
	double d, w;
/*
	cout << fixed;
	cout.precision(12);
	cout << k << endl;
*/
	cin >> n;
	/*for (i = 0; i < n; i++)
		cin >> a[i];
*/
	sum = 0;
	k = 1;
	while (sum < n)
	{
		sum += k;
		k++;
	}
	cout << k - 1 << endl;
	//system("pause");
	return 0;
}

#include <bits/stdc++.h>
//#include <cmath>
#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mod 1000000007
//#define lld long double
#define mii map<int, int>
#define mci map<char, int>
#define msi map<string, int>
#define pii pair<int, int>
#define ff first
#define ss second
#define bs(yup,x) binary_search(yup.begin(),yup.end(),x) //it will return bollean value
#define lb(yup,x) lower_bound(yup.begin(),yup.end(),x)  //it will return the adress of the number which is equal to or just greater than x ,and if it is equal to yup.end() than their in no such number exist
#define ub(yup,x) upper_bound(yup.begin(),yup.end(),x)
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
using namespace std;
const long long N=200005, INF=2000000000000000000;
const long double EPS= 0.000000000001;
int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }
vi prime;
bool isprime[N];
void pre()
{
    for(int i=2;i<N;i++)
    {
        if(isprime[i])
        {
            for(int j=i*i;j<N;j+=i)
            isprime[j]=false;
            prime.pb(i);
        }
    }
    return;
}

class yup
{
 public : int gcd(int a, int b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }
  int lcm(int a, int b)
 {
    return (a*b)/gcd(a, b);
 }
} ;
int minCoins(int coins[], int m, int V)
{
   // base case
   if (V == 0) return 0;

   // Initialize result
   int res = INT_MAX;

   // Try every coin that has smaller value than V
   for (int i=0; i<m; i++)
   {
     if (coins[i] <= V)
     {
         int sub_res = minCoins(coins, m, V-coins[i]);

         // Check for INT_MAX to avoid overflow and see if
         // result can minimized
         if (sub_res != INT_MAX && sub_res + 1 < res)
            res = sub_res + 1;
     }
   }
   return res;
}
bool com(int a,int b)
{
    return a>b;

}
int ans=0;
class gfg
{

public:
unsigned int getFirstSetBitPos(int n)
{
    return log2(n & -n) + 1;
}
};

int maxSubArraySum(int a[], int size)
{
    int max_so_far = INT_MIN, max_ending_here = 0;

    for (int i = 0; i < size; i++)
    {
        max_ending_here = max_ending_here + a[i];
        if (max_so_far < max_ending_here)
            max_so_far = max_ending_here;

        if (max_ending_here < 0)
            max_ending_here = 0;
    }
    return max_so_far;
}
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

int32_t main()
{

    IOS;
    fill(isprime, true);
    pre();
    int n;
    cin>>n;
    int ans=0;
    int sum=0;
    for(int i=0;prime[i]<=n;i++)
    {
        sum+=prime[i];
        if(sum>n)
        {
            ans=i+1;
            break;
        }
        else if(sum==n)
        {
            ans=i+2;
            break;
        }
    }
    cout<<ans;
}

#include <bits/stdc++.h>
#include <math.h>

using namespace std;

int main()
{
int n,x;
cin>>n;
x=sqrt(n);
if(n==x*x)cout<<x;
else cout<<x+(n-x*x);
}

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for (int i = a; i <= b; i++)
#define FOD(i, a, b) for (int i = a; i >= b; i--)
#define REP(i, a, b) for (int i = a; i < b; i++)
#define DEBUG(X) { cout << #X << " = " << X << endl; }
#define PR(A, n) { cout << #A << " = "; FOR(_, 1, n) cout << A[_] << " "; cout << endl;}

int main() {
    int n, ans;
    cin >> n;
    if (n <= 2) cout << n;
        else cout << n / 2 + (n % 2);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
ll M = 1e9+7;

int main() {

	ios_base::sync_with_stdio(0);
//	freopen("in.in", "r", stdin);

	int x;
	cin >> x;
	if (x==1){
		cout << "1";
	} else if (x == 2 || x==3) {
		cout << "2";
	}

	ll base = 2;
	ll c = 2;
	while (1) {
		ll b = base/2;
		ll num = (b*(b+1))/2;
		ll nnum = base+2;
		ll nxnum = num+nnum;
		if (x <= num+nnum && x > num) {
			cout << c+1 <<endl;
			return 0;
		}
		c++;
		base = base+2;
	}

	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    int tmp = sqrt(n*2);
    if (tmp*(tmp+1) == n*2 || n == tmp) cout << tmp; else cout << tmp+1;
}

#include<bits/stdc++.h>
#define ll long long
using namespace std;
bool check(ll x,ll n){
    if((x*(x+1))/2>=n)
        return true;
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin>>n;
    ll beg=1,en=n,ans=1;
    while(beg<=en){
            ll mid=(beg+en)/2;
        if(check(mid,n)==true){
            ans=mid;
            en=mid-1;
        }
        else
            beg=mid+1;
    }
    ll an=abs(n-(ans*(ans+1))/2);
    cout<<ans+an;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{int n;
cin>>n;
vector<int> v;
vector<int> v1;
 int c=1;
 int flag=1;
while(c<=1000000000)
{
    int i=1;
    while(i<=4&&c<=1000000000)
    {   if(i==1&&flag==1);
        if(i==1&&flag!=1)
         c*=2;
        if(i==2)
        c*=2;
        if(i==3);
        if(i==4)
        c=(int)(c*5/2);
        v.push_back(c);
        i++;
    }
flag++;
}  long long int sum=0;
 vector<int>:: iterator it;
    for(it=v.begin();it!=v.end();it++)
      {
          sum=sum+*it;
          v1.push_back(sum);
      }
      int count1=1;
      it=v1.begin();
      while(it!=lower_bound(v1.begin(),v1.end(),n))
      {
          count1++;
          it++;
      }

      cout<<count1;

}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#include <map>
#include <set>
#include <vector>
#include <functional>
#include <algorithm>
#include <stack>
#include <list>
#include <queue>
#include <bitset>
//#include <iostream>
//#include <sstream>
using namespace std;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define pf printf
#define sf scanf
#define test_ fprintf(stderr, ">>>>>>>>>>>>>>>>>>>> in <<<<<<<<<<<<<<<<<<<<")
#define deb(x) cerr << ">>>>>>>>>>>>>>>>>>>> " << #x << " = " << x << " <<<<<<<<<<<<<<<<<<<<\n"
#define debd(x) fprintf(stderr, ">>>>>>>>>>>>>>>>>>>> %s = %d <<<<<<<<<<<<<<<<<<<<\n", #x, x)
#define debs(x) fprintf(stderr, ">>>>>>>>>>>>>>>>>>>> %s = %s <<<<<<<<<<<<<<<<<<<<\n", #x, x)
#define debll(x) fprintf(stderr, ">>>>>>>>>>>>>>>>>>>> %s = %lld <<<<<<<<<<<<<<<<<<<<\n", #x, x)
#define deblf(x) fprintf(stderr, ">>>>>>>>>>>>>>>>>>>> %s = %lf <<<<<<<<<<<<<<<<<<<<\n", #x, x)
#define fr(i, a, b) for(int i = a ; i < b ; i++)
#define frr(i, a, b) for(int i = a ; i >= b ; i--)
#define tr(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define trr(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define its(x) static_cast< ostringstream & >( ( ostringstream() << dec << x ) ).str()
#define boost ios_base::sync_with_stdio(false); cin.tie(NULL)
#define mems(a) memset(a, 0, sizeof(a))
#define has(cont, x) ((cont).find((x)) != (cont).end())
#define sz(x) ((int)(x).size())
//typedef
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
//bitmask
int onbit(int x, int pos) {x |= (1 << pos); return x;}
int offbit(int x, int pos) {x &= ~(1 << pos); return x;}
int test(int x, int pos) {return x & (1 << pos);}
int flip(int x, int pos) {x ^= (1 << pos); return x;}
int lsb(int x) {return x & (-x);}
int onbitall(int x, int pos) {x = (1 << pos)-1; return x;}
//constants
const double EPS = 1e-9;
const double PI = 2*acos(0.0);
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
//moves
const int dx1[] = {0, 1, 0, -1};
const int dy1[] = {1, 0, -1, 0};
const int dx2[] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int dy2[] = {-1, 0, 1, -1, 1, -1, 0, 1};

ll fib[100];

int main() {
//  freopen("input.in", "r", stdin);
  fib[0] = 1;
  fib[1] = 2;
  fr(i, 2, 99) fib[i] = fib[i-1] + fib[i-2];
  int res = 0;
  int cur = 0;
  int n;
  sf("%d", &n);

//  tr(it, primes) {
//    debd(*it);
//    if(*it > 100) break;
//  }

  int i = 0;
  while(cur <= n) {
//    debd(fib[i]);
    cur += fib[i++]; res++; cur++;
//    debd(cur);
//    debd(cur);
  }

  pf("%d\n", res);
  return 0;
}

#include<iostream>
#include<cstdio>
#define ll long long
using namespace std;

ll n;

ll pow(ll a,ll k){
    if(k == 0) return 1;

    ll x = pow(a,k/2);
    if(k%2 == 0) return (x*x);
    else return (x*x) * a;
}

int main(){
	ios::sync_with_stdio(false);
	cin>>n;
	for(int i=1;i<=n;i++){
		if(n >= pow(2,i) && n < pow(2,i+1)){
			cout<<i+1<<endl;
			break;
		}
	}

	return 0;
}

#include <bits/stdc++.h>
#define endl '\n'
#define ld long int

using namespace std;

int main()
{
    ld coins;

    cin >> coins;
    ld re = (log10(coins)/log10(2));
    cout << re + 1 << endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
    long long x, ans = 1;
    cin >> x;
    for(long long i = 100000; i >= 1; i--)
        if(x <= ((i*(i+1))/2))
            ans = i;
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e4+5;
int res[maxn];
void init()
{
    for(ll i=1; i<=maxn-5; i++)
    {
        res[i]=i;
        res[i]+=res[i-1];
    }
}

int main()
{
    init();
    //printf("%d\n", res[maxn-5]);
    int x;
    while(~scanf("%d", &x))
    {
        ll ans=lower_bound(res+1, res+maxn-5, x)-res;
        printf("%d\n", ans);
    }
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
    long long n;
    cin>>n;
    int count=0;
    int x=1;
    while(n){
        if(n>=x){
            n-=x;
            count++;
            x++;
        }
        else{
            n=0;
            count++;
            break;
        }
    }

    cout<<count;
}

#include<cstring>
#include<cmath>
#include<queue>
#include<vector>
#include<map>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
typedef unsigned long long ull;
LL mod = 1e9 + 7;
const double PI = acos(-1.0);
const double eps = 1e-8;
const LL inf = 1 << 30;
inline LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }
inline LL lcm(LL a, LL b) { return a / gcd(a, b) *b; }
int main() {
	int n;
	scanf("%d", &n);
		int i=0, res,s=0;
		while (s  < n/2) {
			i++;
			s += i;
		}
		if (s != n) i++;
		printf("%d\n", i);
	return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;

#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define fr front()
#define ba back()
#define tp top()
#define mem(x) memset(x,0,sizeof(x));
#define sz(x) (int)((x).size())
#define all(x) (x).begin(),(x).end()
#define foreach(it,l) for(auto it=l.begin();it!=l.end();it++)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(x) ((x)<0?-(x):(x))
#define pnl printf("\n")

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef map<char,int> mci;
typedef set<int> seti;
typedef multiset<int> mseti;
const int inf=(1<<30);
const LL llinf=(1ll<<60);
const double eps=(1e-10);
const double phi=2*acos(0.0);
const double GOLD=((1+sqrt(5))/2);
const int xx[8]={1,0,-1,0,1,-1,1,-1};
const int yy[8]={0,1,0,-1,-1,1,-1,1};

/* \( ·w·)~ Clapie ~(·w· )/ */

int main(){
	LL n;
	scanf("%lld",&n);

	LL ans=0;
	for(int i=1;i<=inf;i++){
		ans+=i;
		if(ans>=n){
			 cout<<i<<endl;
			 return 0;
		}
	}
	printf("0\n");
	return 0;
}

#include <iostream>

int main()
{
    int n;
    std::cin >> n;
    long long count = 0;
    while(n > 10)
    {
        count += 4;
        n /= 10;
    }
    if (n != 10)
        switch(n % 10)
        {
            case 1:
                count+= 1;
                break;
            case 2:
                count+= 2;
                break;
            case 3:
                count+= 2;
                break;
            case 4:
                count+= 3;
                break;
            case 5:
                count+= 3;
                break;
            case 6:
                count+= 3;
                break;
            case 7:
                count+= 4;
                break;
            case 8:
                count+= 4;
                break;
            case 9:
                count+= 4;
                break;
            case 0:
                count+= 4;
                break;
        }
    std::cout << count;
    return 0;
}

#include <bits/stdc++.h>
#include <math.h>

using namespace std;

int main()
{
int n,x;
cin>>n;
x=sqrt(n);
/*if(n==x*x)cout<<x;
else*/ cout<<x+1;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
void speed() { ios_base::sync_with_stdio(true); }

void solve()
{
	ll n;
	cin>>n;
	for(ll i=1; ; i++)
	{
		if(i*(i+1)>=2*n)
		{
			cout<<i;
			return;
		}

	}
	//cout<<ans<<endl;

return;
}

int main()
{
	speed();
	ll t=1; //cin>>t;
	//fun();
	while(t--)
	{
		solve();

	}
return 0;
}

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    n=(int)(log(n)/log(2)+1);
    cout<<n;
}

#include<cstring>
#include<string>
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
const double eps=1e-8;
typedef long long LL;
int main()
{
	long long n;
	scanf("%lld",&n);
	LL l=1,r=n;
	LL ans=0;
	while(l<=r)
	{
		LL mid=(l+r)/2;
		if(mid*mid+mid-2*n>=0)
		{
			ans=mid;
			r=mid-1;
		}
		else
		{
			l=mid+1;
		}
	}
	LL Ans2=ans;
	for(LL i=1;i<=ans;i++)
	{
		Ans2=min(Ans2,ans/i+(ans%i!=0)+i-1);
	}
	cout<<Ans2<<endl;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;

#define x first
#define y second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define deb(a) cerr << #a << " = " << a << '\n'
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define deb2(a, b) cerr << #a << " = " << a << ", " << #b << " = " << b << '\n'

const int INF = 1e9 + 7;
const int N = 1e3 + 100;
const ld EPS = 1e-12;
const int P = 239017;

void solve() {
	int n;
	cin >> n;
	if (n == 1)
		cout << 1;
	else if (n == 2)
		cout << 2;
	else
		cout << ceil(log2(n) + 0.5);
}

signed main() {
	FIO;
	int T = 1;
	//cin >> T;
	//cout << fixed << setprecision(0);
	while (T--) {
	    solve();
	}
	return 0;
}

#include<bits/stdc++.h>
#define up(j,k,i) for(i=j;i<k;i++)
#define down(j,k,i) for(i=j;i>k;i--)
#define ipp(n) printf("%d\n",n)
#define pp(n) printf("%lld\n",n)
#define pps(n) printf("%lld ",n)
#define ipps(n) printf("%d ",n)
#define all(x) x.begin(),x.end()
#define ps(s) printf("%s",s)
#define is(n) scanf("%lld",&n)
#define iis(n) scanf("%d",&n)
#define ips(n) scanf("%lld",n)
#define ss(s) scanf("%s",s)
#define cool 0
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define f(i) cout<<i<<endl;
#define pll pair<lld,lld>
#define pi acos(-1)
#ifdef G
#define dg(x) cout<<#x<<' '<<x<<endl;
#define dg2(x,y) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<endl;
#define dg3(x,y,z) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<endl;
#define dg4(x,y,z,zz) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<' '<<#zz<<' '<<zz<<endl;
#else
#define dg(x) ;
#define dg2(x,y) ;
#define dg3(x,y,z) ;
#define dg4(x,y,z,zz) ;
#endif
#define ds(n,m) scanf("%lld %lld",&n,&m)
#define ids(n,m) scanf("%d %d",&n,&m)
#define ts(n,m,k) scanf("%lld %lld %lld",&n,&m,&k)
#define its(n,m,k) scanf("%d %d %d",&n,&m,&k)
#define yes printf("YES\n")
#define no printf("NO\n")
#define isset(num,i) ((num&(1LL<<i))!=0)
typedef long double ld;
typedef long long int lld;
using namespace std;
const lld M =2e5+10;
const lld mod=1e9+7;
const lld infi =LLONG_MAX;
lld ans,k,n,x,y,m,mymax=LLONG_MIN,mymin=LLONG_MAX,b,c,z,sum;
vector<lld> v[M];
int main()
{
    lld i,j;
    is(n);
    if(n==1)
    {
    	ans=1;
    	pp(ans);
    	return 0;
    }
    if(n%3==0)
    {
    	ans=n/3+1;
    }
    else if(n%3==1)
    {
    	ans=n/3+2;
    }
    else
    {
    	ans=n/3+2;
    }
    pp(ans);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int a[100000+5],p[100000-5];
int len;
void init()
{
    a[1] = 0; a[0] = 1;
    len = 0;
    p[len++] = 1;
    for(int i = 2; i <= 100000; i++)
    {
        if(a[i]) continue;
        for(int j = 2; i*j <= 100000; j++)
        {
            a[i*j] = 1;
        }
        p[len++] = i;
    }
}
int main()
{
    init();
    int n;
    scanf("%d",&n);
    int cnt = 0;

    int i = 0;
    while(n > 0)
    {
        n -= p[i];
        i++;
    }

    printf("%d\n",i);

    return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <assert.h>
#include <cmath>
using namespace std;
inline int read() {
	char c = getchar(); int n = 0, f = 0;
	while (c < '0' || c > '9') { if (c == '-') { f = 1; } c = getchar(); }
	while (c >= '0' && c <= '9')
	{
		n = (n << 1) + (n << 3) + (c & 15);
		c = getchar();
	}
	return f ? -n : n;
}
inline char readLetter() {
	char c = getchar();
	while ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z')) { c = getchar(); }
	return c;
}
int main()
{
	int n = read();
	int count = 0;
	for (int i = 1; n - i > 0; i++)
	{
		n -= i;
		count++;
	}

	cout << ++count;
	return 0;
}

#include<cstring>
#include<string>
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
const double eps=1e-8;
int main()
{
	long long n;
	scanf("%lld",&n);
	double ans=(-1+sqrt(1+8*n))/2 ;
	long long ans2=ceil(ans);
	printf("%lld\n",ans2);
}

#include <iostream>
#include<bits/stdc++.h>

using namespace std;
#define ll long long
int n;
int maxx=1e9+10;
int ans;
void binary_find(int l,int r,ll x)
{
    ll mid;
    ll sum;
    while(l<=r){
        mid=(l+r)>>1;

        sum=mid*mid+mid;
        if(sum>x){
            r=mid-1;
            ans=mid;
            cout<<sum<<" "<<x<<endl;
        }
        else if(sum<x){
            l=mid+1;
            cout<<sum<<" "<<x<<endl;
        }
        else
            {
                ans=mid;
                return ;
            }
    }
}
int main()
{
    cin>>n;
    binary_find(1,n,2*n);
    cout<<ans<<endl;
    return 0;
}

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<math.h>
using namespace std;
int map[45000];
int main(){
	int n;
	for(int i=1;i<=45000;i++){
		map[i]=(i+1)*i/2;
	}
	int j;
	scanf("%d",&n);
	for(j=1;;j++){
		if(n<=map[j]){
			break;
		}
	}
	cout<<j<<endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    int tmp = sqrt(n);
    if (tmp*(tmp+1)/2 >= n/2 + (n % 2))
        cout << tmp + 1;
    else cout << tmp + 2;
}

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define inf 10000000000000000000
#define each(n) for(i=0;i<n;i++)
#define eachs(s) for(i=0;s[i]!='\0';i++)
#define range(st,en) for(i=st;i<en;i++)
#define count(i,st,en) for(i=st;i<en;i++)
#define revc(i,en,st) for(i=en;i>=st;i--)
#define decimal(n) fixed<<setprecision(n)
#define lli long long int
#define li long int
#define input(arr) each(n)cin>>arr[i];
#define pb(n) push_back(n)
#define fi first
#define se second
#define vr vector

int main() {
	// your code goes here
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n,sum,low,high,mid,last,lasts,flag=0;
    cin>>n;
    low=1;high=n;
    while(low<=high)
    {
    	mid=(low+high)/2;
    	sum=(mid*(mid+1));
    	sum/=2;
    	if(sum==n)
    	{
    		flag=1;
    		break;
    	}
    	else if(sum>n)
    		high=mid-1;
    	else
    	{
    		last=mid;
    		lasts=sum;
    		low=mid+1;
    	}

    }

    if(flag==0)
    	cout<<last+1;
    else
    	cout<<mid;
	return 0;
}

#include<iostream>
#include<math.h>
using namespace std;

int main(){

    int n;
    cin >> n;

    cout << int(log(n)/log(2))+1;

    return 0;
}

#include <iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>

using namespace std;

#define ll long long

bool isPrime(ll a)
{
    if(a==2 or a==3)
    {
        return true;
    }
    for(ll i=2;i<=sqrt(a);i++)
    {
        if(a%i==0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
//freopen("a.in","r",stdin);
    ll n,c=1,sum=1;
    cin>>n;
    for(ll i=2;i<=n;i++)
    {
        if(isPrime(i))
        {
            c++;
            sum+=i;
            if(sum==n)
                break;
            if(sum>n)
            {
                c--;
                break;
            }
        }
    }
    cout<<c;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define debug(x) cout<< #x" " << x << endl;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    ll n;
    cin >> n;
    ll  p=1;
    ll d=0;
    ll c=0;
    while(p<n)
    {
        p+=d;
        d=p+1;
        c++;
    }

    cout << c;
    return 0;
}

// Devarshi

#include<bits/stdc++.h>

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

const int maxn=1000001;

int main(){
//cout<<"yes";
ll n;
cin>>n;
ll i=1;

while(i*(i-1)/2<n){
    i++;
   // cout<<i;
}
cout<<i-1;
return 0;
}

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    cout<<(int)(log(n)/log(2)+2-1);
}

#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define spc " "
//vector<long> vet(100 * 1000 * 2);
//vector<int> a,b,c;
//int d[1001][8];
//vector<int> primo;
vector<int> vet(1001),vet2(1001);
long long n,k,resp;
//map<int,int> coffe;
//vector<int>resp;
//set<int>s;
char aux;
//int all=(1<<0 | 1<<1 | 1<<2);
//long long aux,a,b,x,y;

int main(){
	ios::sync_with_stdio(false);
    cin.tie(nullptr);
	cin>>n;

	long long i=k=1;

	while(k<n){
		i++;
		k+=i;
	}
	if(k!=n)i--;
	cout<<i<<endl;

}

#include <bits/stdc++.h>
using namespace std;
int main()
{
  long long int x, cnt = 0;
  cin >> x;
  cnt = log2(x);
  cnt += x - (1 << cnt);
  cout << cnt << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,i,cnt=0;
    cin>>n;
    for(i=1;n>0;i++)
    {
        n=n-i;
        cnt++;
    }
    cout<<cnt<<endl;
    return 0;

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n;
	long long int i;
	cin>>n;
	for(i=1;i<=sqrt(n)+10;i++)
	{
		if(i*(i+1)>=2*n && i*(i-1)<2*n)
		{
			cout<<i;
			break;
		}
	}
	return 0;
}

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Apolloliu
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

using namespace std;

void get() {

}

class APackets {
public:
	void solve(std::istream& in, std::ostream& out) {
		int n;
		in >> n;
		int res = 0;
		int i;
		for (i = 0; ; ++i) {
			res += i;
			if(res >= n)break;
		}
		out << i << endl;
	}
};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	APackets solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

#include <bits/stdc++.h>

using namespace std;
#define ll long long
ll b[100010];
int main()
{
    for(ll i=1 ; i<=100010 ; i++)
        b[i]=b[i-1]+i;
    ll n;
    cin>>n;
    ll o=lower_bound(b,b+100010,n)-b;
    cout<<o;
    return 0;
}

#include <iostream>

int main()
{
    int n;
    std::cin >> n;
    long long count = 0;
    while(n >= 10)
    {
        count += 4;
        n /= 10;
    }
    switch(n % 10)
    {
        case 1:
            count+= 1;
            break;
        case 2:
            count+= 2;
            break;
        case 3:
            count+= 2;
            break;
        case 4:
            count+= 3;
            break;
        case 5:
            count+= 3;
            break;
        case 6:
            count+= 3;
            break;
        case 7:
            count+= 4;
            break;
        case 8:
            count+= 4;
            break;
        case 9:
            count+= 4;
            break;
        case 0:
            count+= 4;
            break;
    }
    std::cout << count;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x;
    cin>>x;
    cout<<(int)(log(x)/log(2))+1;
    return 0;
}

#include<iostream>
#include<string>
#include<fstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<cstdlib>
#include<vector>
#include<set>
#include<deque>
using namespace std;
ofstream fo("test.out");
ifstream fi("test.inp");
#define For(i,n) for (long long(i) = 0; (i)<(n); (i)++)
#define For1(i,n) for (long long(i) = 1; (i) <= (n); (i)++)
#define Forlr(i,l,r) for (long long(i) = (l); (i) <= (r); (i)++)
#define Forrl(i,r,l) for (long long(i) = (r); (i) >= (l); (i)--)
#define ll long long
#define pb push_back
#define pp pop_back
#define mp make_pair
const ll MOD = 1e9 + 7;
const ll base = 269;
const int oo = 1 << 30;
const int N = 1e5 + 5;
ll P(ll x, ll y) // x^y
{
	ll ret = 1;
	while (y > 0)
	{
		if (y & 1) ret *= x;
		y /= 2;
		x = x * x;
	}
	return ret;
}
ll GCD(ll a, ll b)
{
	return (b ? GCD(b, a%b) : a);
}
/*
MIKUNO - 15/02/1999
*/

ll n, m, q, k, pos, rs, ans;
ll BS(ll x)
{
	ll l = 1, r = 1e9, mid, ret = -1;
	while (l <= r)
	{
		mid = (l + r) >> 1;
		ll t = mid * (mid + 1) >> 1;
		if (t < x) l = mid + 1;
		else
		{
			ret = mid;
			r = mid - 1;
		}
	}
	return ret;
}
map<ll, ll>a;
map<ll, ll>::iterator it;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll x;
	cin >> x;
	ll t = BS(x);
	n = t;
	ll i = 1, s = 0;
	while (1)
	{
		ll temp = (t * (t + 1) >> 1) - i - s;
		if (temp >= x && a[i])
		{
			s += i;
			n--;
		}
		if (temp >= x && !a[i])
		{
			a[i] = 1;
			vector<ll>vec;
			for (it = a.begin(); it != a.end(); it++)
			{
				vec.pb(it->first + i);
			}
			For(j, vec.size())
				a[vec[j]]++;
			vec.clear();
		}
		if (temp < x) break;
		i++;
	}
	cout << n;
}

#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false); cin.tie(nullptr);
  int n;
  cin >> n;
  int sum = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    sum += i;
    ans++;
		if (sum >= n) {
      break;
    }
  }
  printf("%d\n", ans);
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main() {
	int n , cnt = 0 , ch  = 0 ;
	cin >> n ;
	if (n<= 2 ) return cout << n , 0  ;
	int t = sqrt(n) ;
	if (t*t == n  ) {
		while (1){
				++cnt ;
				ch += cnt ;
				if (ch >= n) break ;
			}
		cout << cnt  - 1 ;
		return 0 ;
	}
	while (1){
		++cnt ;
		ch += cnt ;
		if (ch >= n) break ;
	}
	cout << cnt ;

	return 0;
}

#include<stdio.h>
#include<iostream>
#include<math.h>

using namespace std;
int main()
{
    long long int n;
    cin>>n;
cout<<int(log(1+n)/log(2))+1;

    return 0;

}

#include <iostream>
using namespace std;
int main() {
	int x;
	cin>>x;
	int ans=0;
	while(x>0){
		ans++;
		x-=ans;
	}
	cout<<ans;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
map<ll,ll>dp;

int fun(ll n)
{
   if(n!=0&&dp[n]==0)
   {   ll i=1;
       while(n>((i*(i+1))/2))
       {
           i++;
       }
       dp[n]=1+fun(n-i);
   }
   return dp[n];
}
int main()
{
    ll n;
    cin>>n;
    dp[1]=1;
    dp[0]=0;
    cout<<fun(n);
}

#include <bits/stdc++.h>
using namespace std;
#define all(v)          ((v).begin()), ((v).end())
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define clr(v,d)		memset(v, d, sizeof(v))
const double EPS = 1e-8;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int>P;
const ll mod = ll(1e9 + 7);
int dx[] = { 0, 0, -1, 1, 1, 1, -1, -1 };
int dy[] = { 1, -1, 0, 0, 1, -1, -1, 1 };
const int N = 500001;
#define endl '\n'
#define F first
#define S second
#define pii pair<int,int>
#define sz(v) ((int)((v).size()))
#define pll pair<ll,ll>
void stop(){
#ifndef ONLINE_JUDGE
	system("pause");
#endif
}
struct point{
	double x, y;
};
ll gcd(ll a, ll b){ return !b ? a : gcd(b, a % b); }
ll fixMod(ll a, ll b){ return ((a%b) + b) % b; }
double triangle_area(int x1, int y1, int x2, int y2, int x3, int y3) {
	return abs((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1)) / 2.;
};
ll dis(point a, point b) {
	ll x = a.x - b.x, y = a.y - b.y;
	return x * x + y * y;
}
int main(){
	fast
		ll n;
	cin >> n;
	for (ll i = 0; i <= n; i++){
		if (i*(i + 1)/2 >= n){
			cout << i;
			break;
		}
	}

	stop();
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

long long n, ans = 0, dem = 0, res = 0;

int main()
{
    cin >> n;
    while (ans < n)
    {
        ans += dem+1;
        dem += ans;
        res ++;
    }
    cout << res;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
    long long n,m;
    cin>>n;
    m=n;
    int count=0;
    if(n==2){
        cout<<"2";
    }
    int x=1;
    while(n){
        if(n>=x){
            n-=x;
            count++;
            x++;
        }
        else{
           long long k;
           k=(x-2)*(x-1)/2;
           if(x-1+n<=k+1){
               break;
           }
           else{
               count++;
               break;
           }
        }
    }

    cout<<count;
}

/*  ~*BISMILLAHIR RAHMANIR RAHIM*~  */
#include <bits/stdc++.h>
using namespace std;
typedef long long intl;
#define MX_N 500005

int main() {
  int n;
  cin >> n;
  int res = 0;
  intl now = 0, cnt = 0;
  while( now < n ) {
    cnt++, res++;
    now += cnt;
  }
  printf("%d\n", res);
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
int main ()
{
  cin>>n;
  ll ans = 0;
  ll l = 1,r = n;
  while(l<r)
  {
    ll mid = (l+r)>>1;
    if((ll)((ll)(mid+1)*(ll)mid)/2.0 >= n) r = mid;
    else l = mid+1;
  }
  cout<<l<<endl;
  return 0;
}

#include <iostream>
#include <cmath>
using namespace std;

long long int getAns(long long int x){
    double d = (-1 + sqrt(8*x+1))/2;
    return ceil(d);
}

int main()
{
    cout << getAns(1000000000) << endl;
    return 0;
}

#include<iostream>
#include <cmath>
using namespace std;

int main() {
	int n;
	cin >> n;
	cout << round(sqrt(2 * n))<< endl;
	//	system("pause");
	return 0;
}

#include <iostream>
#include <unordered_set>
#include <string>
#include <map>
#include <unordered_map>
#include <random>
#include <set>
#include <cassert>
#include <string.h>
#include <limits.h>
#include <stack>
#include <functional>
#include <queue>
#include <iomanip>
#include <numeric>
#include <bitset>
#include <iterator>
#include <algorithm>
#include <sstream>

#define inf 0x3f3f3f3f
#define sup_inf 2e18
#define pb push_back
#define ii pair<int,int>
#define f first
#define s second
#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define iii pair<int, ii >
#define in freopen("arquivoentrada","r",stdin);
#define out freopen("myfile.txt", "w", stdout);
#define eps 1e-9
#define pi 3.14159265359
const int mod = 1e9 +7  ;

using namespace std;
typedef vector<int> vi;
typedef unsigned long long ull;
typedef long long ll;

using namespace std;

const int maxn = 3e5 + 100;
const int MAX = 350;

int n ;
int pa ( int n ) {
	return n * double (n  + 1)  / 2 ;
}
signed main  (){

	cin >> n;

	int i;
	for( i = 1; pa(i) < n ;i++);
	cout << i << '\n';

}

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define mii         map<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define hell        1000000007
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define SIZE        1000005
#define F           first
#define S           second
#define debug(x)        cerr << #x << " = " << x << endl;
using namespace std;
void solve()
{
   ll n; cin>>n;
   ll sum=0; ll i=0;
   if(n==1) {cout<<1; return;}
   while(sum<n){
    i++;
    sum+=i;
   }
   if((n-1)==((i-1)*(i))/2 && n!=2) cout<<i-1;
   else cout<<i;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t; t=1;
    while(t--){
        solve();
    }
    return 0;
}

#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
    int n;
    scanf("%d", &n);
    printf("%d", ceil(log2(n)));
}

#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;
int sum[N];
int main() {
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
#endif
	int n;
	scanf("%d", &n);
	int s = 0, i;
	int sz = 0;
	for (i = 1; i <= 1000000; ++i) {
		s += i;
		sum[sz++] = s;
		if (s > n) {
			break;
		}

	}
	long long cnt = 0;
	for (int i = sz - 1; i >= 0; --i) {
		while (sum[i] <= n && sum[i + 1] > n) {
			n -= sum[i];
			cnt += (i + 1);
		}
	}
	printf("%lld", cnt);
}

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin.exceptions(cin.failbit);
#define int long long
#define ll long long
#define rep(i,a,b) for(int i=a;i<b;++i)
#define fre(i,a,b) for(int i=a;i<=b;i++)
#define sep(i,a,b) for(i=a-1;i>=b;i--)
#define sp(i,n)  for(int i=n-1;i>=0;i--)
#define rp(i,n) rep(i,0,n)
#define fr(i,n) fre(i,1,n)
#define trav(a, x) for (auto& a : x)
#define pb push_back
#define endl "\n"
#define fi first
#define se second
#define vi vector<int>
#define all(c) (c).begin(),(c).end()
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b)) / gcd((a),(b))
#define bc(n) __builtin_popcountll(n)
typedef long double ld;

#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << endl;}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<"  ";__f(comma+1, args...);}
#else
#define trace(...)
#endif

auto clk=clock();
const int mod = 1e9+7;
//const int mod = 998244353;

signed main()
{
    IOS;
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout<<fixed<<setprecision(10);
    #ifndef ONLINE_JUDGE
//        freopen("input.txt", "r", stdin);
//        freopen("output.txt", "w", stdout) ;
    #endif // ONLINE_JUDGE

    int n ;
    cin >> n ;
    if(n==2){cout << 2 ; return 0 ; }
    cout << (int)ceil(log(n/2)/log(2))+1 << endl ;

return 0 ;
}

#include<bits/stdc++.h>
using namespace std;

int main() {
int n,i,mul=1; scanf("%d",&n);

if(n==1) {printf("1"); return 0;}
if(n==2) {printf("2"); return 0;}
for(i=0;i<n;i++){if(mul>=n){printf("%d",i); return 0;} mul=mul*2; }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int x;
    cin>>x;
    cout<<(int)(log(x)/log(2))+1;
    return 0;
}

#include<bits/stdc++.h>
#define vi vector<int>
#define vll vector<long long>
#define ll long long
#define ull unsigned long long
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(NULL)
#define nl cout<<'\n'
#define pb push_back
#define mp make_pair
#define pi pair<int,int>
#define pll pair<long long,long long>
#define vpii vector<pair<int,int> >
#define vpll vector<pair<ll,ll> >
#define si set<int>
#define sll set<long long>
#define all(v) (v).begin(),(v).end()
#define Unique(x)           (x).erase(unique(all(x)), x.end())
#define v_present(vec,x)  (find(all(vec),x)!=(vec).end())
#define present(myset,x)    ((myset).find(x)!=(myset).end())
#define Cprint(c)  for(auto i:(c)) { cout<<i<<" "; } nl

ll mod = 1e9+7;
const int MAX = 1e5+5;
using namespace std;

int main()
{
FAST_IO;
ll n;
cin>>n;
ll ans=0;
if(n==2)
{
	cout<<"2";
	return 0;
}
while(1)
{
	n=ceil((double)n/2.0);
	ans++;
	if(n==1)
	break;
}
cout<<ans;
return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,a,n) for(int i=a;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define pb push_back
#define mp make_pair
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef vector<ll>		vi;
typedef vector<pii>		vpii;
typedef vector<vi>		vvi;
const ll maxn = 1e5+6 ;
const ll MOD = 1e9 + 7  ;
 int prim[100001] ;
 int fact[maxn] ;

 bool isVowel(char ch) {

    if(ch == 'a' || ch == 'i' || ch == 'e' || ch == 'u' || ch == 'o' || ch == 'y'){
        return true;
    }
    return false;
}
ll power(ll x, ll i,ll mod)
{
	ll ans = 1;
	while(i > 0)
	{
		if(i&1)
			ans = (ans*x)%mod;
		i >>=1;
		x = (x*x)%mod;
	}
	return ans;
}

ll modInverse(ll x, ll mod)
{
	return power(x , mod-2,mod);
}
int nCr (int n , int r) {
    if(n < r) {
        return 0;
    }
    return ( ( ( fact[n] * modInverse(fact[n-r], MOD) ) % MOD ) * modInverse(fact[r],MOD) ) % MOD;
}

void erath() {
    int n = 100000 ;
    for(int i=1 ; i<=n ; i++){
        prim[i] = 1 ;
    }
    prim[1] = 0 ;
    prim[0] = 0 ;prim[2] = 1 ;
    for(int i=2 ; i*i<=n ; i++){
        if(prim[i]){
        for(int j=i*i ; j <=n ; j+=i){
            prim[j] = 0 ;
         }
        }
    }

   }
 void dfs(int k , int tar ,bool& ok){
      if(k>tar){
        return ;
      }
     // cout<<k<<" "<<tar<<endl;
      if(k==tar){
        ok = 1 ;
        return ;
      }
      dfs(2*k , tar , ok) ;
      dfs(10*k+1 , tar , ok) ;
  }
  int genh(string s){
     int ans = 0 ;
     for(int i=0 ; i<s.size() ; i++){
        ans+=(i+1)*int(s[i]) ;
     }
     return ans ;
  }
 int gcd( int a, int b)
{
  if (b == 0)
    return a;
  return gcd(b, a % b);
}

// Function to return LCM of two numbers
int lcm(int a, int b)
{
    return (a / gcd(a, b)) * b;
}

void ans() {
   ll n ; cin>>n;
   int ans = 0 ;
   if(n==1) {cout<<1<<endl;return;}
   while(n > 0){
      if(n==2 || n==3){
        ans+=2 ;
        n = 0 ;
        break ;
      }else {
         ans++ ;
         if(n & 1 && (n>1)) n++ ;
         n/=2 ;
       }
   }
   cout<<ans<<endl;
}
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

   int t = 1;

  // cin >> t;
    while(t--) {
      ans();
    }

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define PB push_back
#define MP make_pair
#define f first
#define s second
#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define RFOR(i, b, a) for (int i = b-1; i>=a; --i)
#define FILL(a, b) memset(a, b, sizeof a)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)a.size()

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
//#define double long double

const int INF = 1000 * 1000 * 1000;
const LL LINF = 1LL * INF*INF;
const int MAX = 1e5;
const double PI = acos(-1.);
const double EPS = 1e-8;
const LL mod =1000*1000*1000+2015;

int main()
{
	//freopen("In.txt", "r", stdin);
	ios_base::sync_with_stdio(0);
	LL n;
	cin >> n;
	LL ans=1;
	int i=1;
	int x=1;
	while(x+i<=n)
	{
		x+=i;
		i=x+1;
		ans++;
	}

	cout << ans;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n;
	cin>>n;
	cout<<(int)(log(2*n)+1);
}

#include<bits/stdc++.h>
using namespace std;

int main(){
long long int n;
cin>>n;
for(int j=1;j<=n;j++){
    if(j*(j+1)>=(2*n)){
        cout<<j;
        break;
    }
}
return 0;
}

#include <bits/stdc++.h>
#define pb push_back
#define sc1(n) scanf("%lld",&n)
#define sc2(a,b) scanf("%lld%lld",&a,&b)
#define sc3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define MX 100000
using namespace std;

typedef long long int ll;
typedef unsigned long long ul;

ll arr[100005];
ll cum[5001];
int main()
{
    arr[1]=1;
    arr[2]=2;
    for(ll i=3;i<=200;i++)
    {
        arr[i]=arr[i-1]+arr[i-2]+1;
    }

    //cout<<arr[200]<<endl;

    cum[0]=0;
    for(ll i=1;i<=200;i++)
    {
        cum[i]=arr[i]+cum[i-1];
    }
    //cout<<cum[200]<<endl;
    ll n;
    sc1(n);
    ll cnt=0;
    for(ll i=1;i<=200;i++)
    {
        cnt++;
        if(cum[i]>=n)
            break;
    }
    printf("%lld\n",cnt);
    //main();
}

#include <iostream>
using namespace std;
int main() {
	int x;
	cin>>x;
	int ans=0;
	while(x>0){
		ans++;
		x-=ans;
	}
	cout<<ans;
}

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int main ()
{
    int a,b;
    cin>>a;
    b=(int)(log((double)a)/log((double)2));
    cout<<b;
    return 0;
}

#include <iostream>
#include <math.h>
using namespace std;
int n, res;
int main()
{
    cin>>n;
    res=(int)(log(n)/log(2))+1;
    cout<<res;
    return 0;
}

#include<bits/stdc++.h>
#define up(j,k,i) for(i=j;i<k;i++)
#define down(j,k,i) for(i=j;i>k;i--)
#define ipp(n) printf("%d\n",n)
#define pp(n) printf("%lld\n",n)
#define pps(n) printf("%lld ",n)
#define ipps(n) printf("%d ",n)
#define all(x) x.begin(),x.end()
#define ps(s) printf("%s",s)
#define is(n) scanf("%lld",&n)
#define iis(n) scanf("%d",&n)
#define ips(n) scanf("%lld",n)
#define ss(s) scanf("%s",s)
#define cool 0
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define f(i) cout<<i<<endl;
#define pll pair<lld,lld>
#define pi acos(-1)
#ifdef G
#define dg(x) cout<<#x<<' '<<x<<endl;
#define dg2(x,y) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<endl;
#define dg3(x,y,z) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<endl;
#define dg4(x,y,z,zz) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<' '<<#zz<<' '<<zz<<endl;
#else
#define dg(x) ;
#define dg2(x,y) ;
#define dg3(x,y,z) ;
#define dg4(x,y,z,zz) ;
#endif
#define ds(n,m) scanf("%lld %lld",&n,&m)
#define ids(n,m) scanf("%d %d",&n,&m)
#define ts(n,m,k) scanf("%lld %lld %lld",&n,&m,&k)
#define its(n,m,k) scanf("%d %d %d",&n,&m,&k)
#define yes printf("YES\n")
#define no printf("NO\n")
#define isset(num,i) ((num&(1LL<<i))!=0)
typedef long double ld;
typedef long long int lld;
using namespace std;
const lld M =2e5+10;
const lld mod=1e9+7;
const lld infi =LLONG_MAX;
lld ans,k,n,x,y,m,mymax=LLONG_MIN,mymin=LLONG_MAX,b,c,z,sum;
vector<lld> v[M];
lld find(lld &n)
{
	x=0;
    y=0;
    while(x<=n){
    	y++;
    	x+=y;
    }
    n-=(x-y);
    return y-1;
}
int main()
{
    lld i,j;
    is(n);

    	ans=find(n);
    	if(n>0)ans++;
    	pp(ans);

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long n;
	cin>>n;
	if(n<=3){
		cout<<n<<endl;
	}else{
		int ans=0;
		int temp=7;
		while(n>=temp){
			ans++;
			temp*=2;
		}
		cout<<3+ans<<endl;
	}
	// cout<<ans;
}