import std.algorithm; import std.stdio; import std.conv; import std.string; void main(){ auto n = readln.strip.to!ulong; auto max = n - 1; auto r = (a){ import std.container; SList!ulong v; auto i = 2; while(a != 1){ while(a % i == 0){ v.insertFront(i); a /= i; } i++; } return v; }(n); ulong[] v = [1, 1, 1]; foreach(a; r[]){ v[v.minCount[1] - 1] *= a; } auto min = v.map!("a-1").sum; writef("%d %d", min, max); }