#include #include #include #include #include #include #include #include #include using namespace std; #define MOD 1000007 long long func(long long &n, long long i){ //return n*n/4LL + n; return ((i+1LL)*(n-i+1LL) - 1LL); } long long check(long long &n){ long long ans = 0; for(long long i=1; i<=n; i++){ ans = max(ans, (i+1)*(n-i+1) - 1); } return ans; } int main(){ long long n; cin >> n; n%=MOD; cout << (n*n/4LL + n)%MOD << endl; /* long long ans = func(n, 1); ans = max(ans, func(n, n)); for(long long i=-4; i<=4; i++){ if(n/2LL + i < 0 || n/2LL +i > n) continue; ans = max(ans, func(n, n/2LL+i) ); } cout << (ans%MOD) << endl; //cout << check(n)%MOD << endl; */ return 0; }