#include<bits/stdc++.h> using namespace std; int n,m,a,b,c; int main() { cin>>n; m=sqrt(n); a=n/m; b=n-a*m; c=pow(a,m-1)*(b+m); cout<<c; }