//おとなしく愚直に数えます #include #include #include #define int long long using namespace std; int n; set dict; string toString(int x) { string s; while (x > 0) { s += (char)('0' + (x % 10)); x /= 10; } string ret; for (int i = s.length() - 1; i >= 0; i--) ret += s[i]; return ret; } signed main() { cin >> n; for (int i = 1; i * i <= n; i++) { if (n % i == 0) { dict.insert(toString(i) + toString(n / i)); dict.insert(toString(n / i) + toString(i)); } } cout << dict.size() << endl; return 0; }