#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int N = 1e6 + 10;
int t, n, m, k, l, r, op, x, y;
int f[N];
bool flag;
int g(int x) {
int cnt = 0;
while (x) {
cnt += x % 10;
x /= 10;
}
return cnt;
}
void solve() {
while (cin >> n) {
cout << g(n) << " " << g(n * n) << "\n";
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}