#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4,avx2,tune=native")
const char nl = '\n';
using namespace std;
using ll = long long;
using ld = long double;
const int N = 2e5 + 10;
vector<int> divs[N];
int pref[N];
int chi[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  const int n = s.size();
  for (int i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] + (s[i - 1] == '1');
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j += i) {
      divs[j].push_back(i);
    }
  }
  ll ans = 0;
  for (int sz = 1; sz <= n; sz++) {
    for (int d : divs[sz]) {
      chi[d] = 1;
    }
    int cur = 0;
    for (int i = 0; i + sz <= n; i++) {
      cur += chi[pref[i + sz] - pref[i]];
    }
    ans += cur;
    for (int d : divs[sz]) {
      chi[d] = 0;
    }
  }
  cout << ans << nl;
}
