#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <cassert>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <time.h>
#include <complex>
#include <bitset>
using namespace std;

#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, b, a) for(int i=(b)-1;i>=(a);--i)
#define FILL(A,value) memset(A,value,sizeof(A))

#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define Pi 3.14159265358979
#define x0 ikjnrmthklmnt
#define y0 lkrjhkltr
#define y1 ewrgrg

typedef long long Int;
typedef unsigned long long UInt;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<Int, Int> PLL;
typedef pair<double, double> PDD;
typedef complex<double> base;

const int INF = 1000000000;
const int BASE = 1000000007;
const int MAX = 107;
const int MAXX = 1000000;
const int ADD = 1000000;
const int MOD = 998244353;
const int CNT = 800;

int N;
string S;

struct state
{
    UInt a , b;
    int len;
    state()
    {
        a = 0;
        b = 0;
    }
    
    int get(int id)
    {
        if (id < 64)
        {
            return (a >> id) & 1;
        }
        return (b >> (id - 64)) & 1;
    }
    
    void set1(int id)
    {
        if (id < 64)
        {
            a |= (1LL << id);
        }
        else
        {
            b |= (1LL << (id - 64));
        }
    }
    
    int eval()
    {
        int mask = (1 << len) - 1;
        int cnt = 0;
        FOR(i,0,N)
        {
            if (get(i))
            {
                if (S[i] == '0')
                {
                    mask &= ~(1 << (cnt % len));
                }
                ++ cnt;
                if (cnt == len) cnt = 0;
                
            }
        }
        
        return mask;
    }
    
    pair<state , state> splitLen(int ln)
    {
        int cnt = 0;
        state l, r;
        l.len = ln;
        r.len = len - ln;
        
        FOR(i,0,N)
            if (get(i))
            {
                if (cnt < ln)
                    l.set1(i);
                else
                    r.set1(i);
                
                ++ cnt;
                if (cnt == len) cnt = 0;
            }
        return MP(l, r);
    }
    
    bool operator<(const state & st)const
    {
        return MP(MP(a , b) , len) < MP(MP(st.a , st.b) , st.len);
    }
    
    
};

map<state , int> MA;
map<state , int> MB;


int dpA[20][1 << 20];
int dpB[20][1 << 20];

int F(state x);

int G(state x)
{
    if (x.len < 20)
    {
        return dpA[x.len][x.eval()];
    }
    if (MA.count(x)) return MA[x];
    
    
    
    Int res = 0;
    
    FOR(i,1,x.len)
    {
        if (x.len % i == 0)
        {
            state y = x;
            y.len = i;
            res += F(y);
            if (res >= MOD) res -= MOD;
        }
    }
    MA[x] = res;
    return res;
}

int F(state x)
{
    if (x.len < 20)
    {
        return dpB[x.len][x.eval()];
    }
    if (MB.count(x)) return MB[x];

    if (x.len == 1)
    {
        int res = x.eval();
        MB[x] = res;
        return res;
    }
    
    Int res = 0;
    FOR(ln , 1 , x.len)
    {
        pair<state , state> p = x.splitLen(ln);
        res += 1LL * G(p.first) * F(p.second);
        res %= MOD;
    }
    
    res += G(x);
    res %= MOD;
    MB[x] = res;
    return res;
}



int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("distance.in",  "r", stdin);
    //freopen("distance.out", "w", stdout);
    //freopen("out.txt" , "w" , stdout);
    
    
    dpA[1][0] = dpB[1][0] = 1;
    dpA[1][1] = dpB[1][1] = 2;
    
    FOR(len , 2 , 20)
    {
        FOR(mask , 0 , 1 << len)
        {
            FOR(l,1,len)
            {
                dpB[len][mask] += (Int)dpA[len - l][mask >> l] * dpB[l][mask & ((1 << l) - 1)] % MOD;
                dpB[len][mask] %= MOD;
            }
            
            FOR(i,1,len)
                if (len % i == 0)
                {
                    int nm = (1 << i) - 1;
                    FOR(j,0,len / i)
                    {
                        nm &= (mask >> (j * i)) & ((1 << i) - 1);
                    }
                    dpA[len][mask] += dpB[i][nm];
                    dpA[len][mask] %= MOD;
                }
            dpB[len][mask] += dpA[len][mask];
            dpB[len][mask] %= MOD;
        }
    }
    
    
    
    cin >> S;
    N = SZ(S);
    /*N = 100;
    S = "";
    FOR(i,0,N)
    {
        S += '0' + rand() % 2;
    }*/
    
    
    state st;
    FOR(i,0,N)
        st.set1(i);
    st.len = N;
    
    cout << F(st) << endl;
    
    return 0;
}













Measured memory_bytes: 84864