#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target( \
    "fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << '{';
  string sep;
  for (const auto &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename T, size_t size>
ostream &operator<<(ostream &os, const array<T, size> &arr) {
  os << '{';
  string sep;
  for (const auto &x : arr) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << ' ' << H;
  debug_out(T...);
}
unordered_map<long long, bool> dp[2];
bool is_prime(long long n) {
  if (n <= 2) return true;
  if (n & 1 ^ 1) return false;
  for (long long i = 3; i * i <= n; i += 2) {
    if ((n % i) == 0) return false;
  }
  return true;
}
bool solve(long long n, bool which) {
  if (is_prime(n)) return which;
  if (dp[which].find(n) != dp[which].end()) return dp[which][n];
  if (which == 0) {
    bool cur = true;
    for (long long i = 2; i * i <= n; i++) {
      if ((n % i) == 0) {
        const long long A = i;
        const long long B = n / i;
        cur &= solve(A, which ^ 1);
        if (!cur) break;
        cur &= solve(B, which ^ 1);
        if (!cur) break;
      }
    }
    return dp[which][n] = cur;
  }
  int cur = false;
  for (long long i = 2; i * i <= n; i++) {
    if ((n % i) == 0) {
      const long long A = i;
      const long long B = n / i;
      cur |= solve(A, which ^ 1);
      if (cur) break;
      cur |= solve(B, which ^ 1);
      if (cur) break;
    }
  }
  return dp[which][n] = cur;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  if (solve(n, 0) != 0)
    cout << 2 << '\n';
  else {
    cout << 1 << '\n';
    for (long long i = 2; i * i <= n; i++) {
      if ((n % i) == 0) {
        const long long A = i;
        const long long B = n / i;
        if (dp[1].find(A) != dp[1].end() && dp[1][A] == 0) {
          cout << A << '\n';
          return 0;
        }
        if (dp[1].find(B) != dp[1].end() && dp[1][B] == 0) {
          cout << B << '\n';
          return 0;
        }
      }
    }
    cout << 0 << '\n';
  }
  return 0;
}
