#include "bits/stdc++.h"

using namespace std;

const double ice_per_year = 252e9;
const double secs_in_year = 365.0 * 24.0 * 60.0 * 60.0;
const double ice_per_sec = ice_per_year / secs_in_year;

mt19937_64 rng(42);

int main() {
    int n = 1e5;
    long long k = 1e12;

    vector<double> a(n);
    for (int i = 0; i < n; ++i) {
        a[i] = rng() % ((long long)1e12) + 1;
    }
    vector<double> c(n, 1);

    priority_queue<pair<double, int>> pq;
    for (int i = 0; i < n; ++i) {
        pq.emplace(a[i] / c[i] / (c[i] + 1), i);
    }

    cerr << "ice melts per sec in antarctica: " << ice_per_sec << endl;
    auto start_time = clock();
    for (long long i = 0; i < k - n; ++i) {
        int ind = pq.top().second;
        pq.pop();
        c[ind] += 1;
        pq.emplace(a[ind] / c[ind] / (c[ind] + 1), ind);
        if (i % ((int)1e7) == 0) {
            double spent_time = (double)(clock() - start_time) / CLOCKS_PER_SEC;
            double estimated_runtime = spent_time / (i + 1) * (k - n);
            cerr << i << ", spent time: " << spent_time << "s, estimated runtime: " << estimated_runtime << "s";
            cerr << ", estimated ice melts: " << ice_per_sec * estimated_runtime;
            cerr << endl;
        }
    }

    double ans = 0;
    for (int i = 0; i < n; ++i) {
        ans += a[i] / c[i];
    }
    cout << (long long)(ans + 0.5) << '\n';

    return 0;
}
