#include using namespace std; using ll = long long int; using lc = complex; int main(void) { constexpr ll MOD = 1e9 + 7; constexpr double PI = acos(-1); cout << fixed << setprecision(32); cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; vector> dp(n+1, vector(1e4+1)); for(ll i=0; i> y; dp[i+1][0] = dp[i][0] + abs(y); for(ll j=1; j<=1e4; j++) dp[i+1][j] = min(dp[i+1][j-1], dp[i][j] + abs(y-j)); } cout << *min_element(dp[n].begin(), dp[n].end()) << endl; }