#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N = 100100;
const int mod = 1000000007;
ll v[100];

int main()
{
    ll n;
	cin >> n;
	ll z = 1;
	ll minn = n;
	for(int i = 1; i <= 61; i++){
		z = z*2;
		if(n < z){
			break;
		}
		ll k = n / z;
		ll x = k + i + (n-k*z);
		minn = min(minn,x);
	}
	cout << minn << endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair <int, int> pin;

const int N = 4e5 + 5;
const int Maxn = 4e5;
const ll P = 998244353LL;

int n, m;
ll fac[N], ifac[N];

template <typename T>
inline void read(T &X) {
    char ch = 0; T op = 1; 
    for (X = 0; ch > '9' || ch < '0'; ch = getchar())
        if (ch == '-') op = -1;
    for (; ch >= '0' && ch <= '9'; ch = getchar())
        X = (X * 10) + ch - '0';
    X *= op;
}

inline ll fpow(ll x, ll y) {
    ll res = 1;
    for (x %= P; y > 0; y >>= 1) {
        if (y & 1) res = res * x % P;
        x = x * x % P;
    }
    return res;
}

inline ll getc(int x, int y) {
    return fac[x] * ifac[y] % P * ifac[x - y] % P;
}

inline ll solve(int now) {
    vector <int> vec;
    int tmp = now;
    for (int i = 2; i * i <= now; i++) {
        if (tmp % i == 0) {
            int cnt = 0;
            for (; tmp % i == 0; ++cnt, tmp /= i);
            vec.push_back(cnt);
        }
    }
    if (tmp != 1) vec.push_back(1);
    ll res = 1;
    for (int i = 0; i < vec.size(); i++) res = res * getc(vec[i] + n - 1, n - 1) % P;
    return res;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("sample.in", "r", stdin);
    clock_t st_clock = clock();
#endif

    fac[0] = 1;
    for (int i = 1; i <= Maxn; i++) fac[i] = fac[i - 1] * i % P;
    ifac[Maxn] = fpow(fac[Maxn], P - 2);
    for (int i = Maxn - 1; i >= 0; i--) ifac[i] = ifac[i + 1] * (i + 1) % P;
    read(n), read(m);
    ll ans = 0;
    for (int i = 1; i <= m; i++) {
        ans += solve(i);
        if (ans >= P) ans -= P;
    }
    printf("%lld\n", ans);

#ifndef ONLINE_JUDGE
    clock_t ed_clock = clock();
    printf("time = %f ms\n", (double)(ed_clock - st_clock) / CLOCKS_PER_SEC * 1000);
#endif
    return 0;
}