#include <bits/stdc++.h>
using namespace std;
string s;
int n;
const int N = 5005;
vector<int> z[N];
vector<int> z_function(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
bool read() {
  if (!(cin >> s)) return false;
  n = s.length();
  return true;
}
const int BASE = 1000 * 1000 * 1000 + 7;
struct bigint {
  vector<int> digits;
  bigint() { digits = vector<int>(1, 0); }
  bigint(int s) { digits = vector<int>(1, s); }
  int size() const { return digits.size(); }
  int operator[](size_t i) const { return i >= digits.size() ? 0 : digits[i]; }
};
inline bigint operator+(const bigint& a, const bigint& b) {
  vector<int> v(max(a.size(), b.size()));
  int r = 0;
  for (int i = 0; i < int(v.size()); ++i) {
    v[i] = a[i] + b[i] + r;
    if (v[i] >= BASE) {
      v[i] -= BASE;
      r = 1;
    } else
      r = 0;
  }
  if (r) v.push_back(r);
  bigint c;
  c.digits = v;
  return c;
}
inline bigint operator-(const bigint& a, const bigint& b) {
  vector<int> v(max(a.size(), b.size()));
  int r = 0;
  for (int i = 0; i < int(v.size()); ++i) {
    v[i] = a[i] - b[i] + r;
    if (v[i] < 0) {
      v[i] += BASE;
      r = -1;
    } else
      r = 0;
  }
  while (v.back() == 0 && v.size() > 1) v.pop_back();
  bigint c;
  c.digits = v;
  return c;
}
inline bool operator<(const bigint& a, const bigint& b) {
  if (a.size() != b.size()) return a.size() < b.size();
  for (int i = a.size() - 1; i >= 0; --i)
    if (a[i] != b[i]) return a[i] < b[i];
  return false;
}
const int MOD = 1000 * 1000 * 1000 + 7;
inline void update(pair<int, int>& to, const pair<int, int>& wh) {
  to.first = (to.first + wh.first) % MOD;
  to.second = min(to.second, wh.second);
}
pair<int, int> dp[N][N];
pair<int, int> tmp[N];
void solve() {
  for (int i = 0; i < int(n); ++i) z[i] = z_function(s.substr(i));
  for (int i = 0; i < int(n); ++i)
    for (int j = 0; j < int(n); ++j) dp[i][j] = make_pair(0, N);
  for (int i = 0; i < int(n); ++i) dp[i][i + 1] = make_pair(1, 1);
  for (int i = 0; i < int(n - 1); ++i) {
    for (int j = 0; j < int(n + 1); ++j) tmp[j] = make_pair(0, N);
    for (int l = 1; l <= i + 1; ++l) {
      if (dp[i][l].first == 0 || s[i + 1] == '0') continue;
      int lf = i - l + 1, rg = i + 1;
      int diff = z[lf][l];
      int wh;
      if (diff >= l || s[lf + diff] < s[rg + diff])
        wh = l;
      else
        wh = l + 1;
      update(tmp[wh], make_pair(dp[i][l].first, dp[i][l].second + 1));
    }
    for (int j = 0; j < int(n + 1); ++j) {
      if (j) update(tmp[j], tmp[j - 1]);
      if (i + j < n) update(dp[i + j][j], tmp[j]);
    }
  }
  int res = 0;
  for (int i = 0; i < int(n + 1); ++i) res = (res + dp[n - 1][i].first) % MOD;
  bool any = false;
  bigint best, cur = 0, pw = 1;
  for (int l = 1; l <= n; ++l) {
    if (s[n - l] == '1') cur = cur + pw;
    if (dp[n - 1][l].first) {
      bigint u = cur + bigint(dp[n - 1][l].second);
      if (!any)
        best = u;
      else
        best = min(best, u);
      any = true;
    }
    pw = pw + pw;
  }
  cout << res << endl << best[0] << endl;
}
int main() {
  while (read()) solve();
  return 0;
}
