#include "bits/stdc++.h"
using namespace std;
int jiechen(int n) {
    int result = 1;
    for (int i = 1; i <= n; ++i) {
        result = result * i;
    }
    return result;
}
int main() {
    int n;
    int y1, y2 = 0;
    while (cin >> n) {
        for (int i = 1; i <= n; i += 2) {
            y1 += jiechen(i);
        }
        for (int i = 2; i <= n; i += 2) {
            y2 += jiechen(i);
        }
        printf("%d %d", y1, y2);
    }

}