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

#define ll long long
#define deb(x) cerr << #x << ":" << x << "\n"
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pi;

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define int ll

void solve()
{
    ll n;
    cin>>n;
    int p=1,ans=INT64_MAX;
    for(int b=0;b<64 && p<=n;b++){
        int c=n%p;
        int a=n/p;
        ans=min(ans,a+b+c);
        p*=2;
    }
    cout<<ans<<"\n";
}

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("../text_files/input.txt", "r", stdin);
    freopen("../text_files/output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	if(n%100==0)
	{
		cout<<n/100;
		return 0;
	}
	cout<<n/100+1;
	return 0;
}