#include <iostream>
using namespace std;

int main() {
    int n;
    long long factorial = 1; // Using long long for handling larger values

    cout << "Enter a non-negative integer: ";
    cin >> n;

    if (n < 0) {
        cout << "Factorial is not defined for negative numbers." << endl;
    } else {
        for (int i = 1; i <= n; ++i) {
            factorial *= i; // Multiplying with each number up to n
        }
        cout << "Factorial of " << n << " = " << factorial << endl;
    }

    return 0;
}