#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
main(){
    for(int KK = 15 ; KK < 16 ; KK++ )
    {
        char cmd[100], cmd2[100];
        sprintf(cmd,".%d.in",KK);
        sprintf(cmd2,".%d.out",KK);
        freopen(cmd,"r",stdin);
        freopen(cmd2,"w",stdout);
        unsigned long long q,w,e,r,t=1;
          char a[100002];
          cin>>a;
          q=strlen(a);
          w=0;
          while(w<q){
           r=0;
           while((w<q)&&(a[w]+a[w+1]-96==9)){
            w++;r++;}
           if((r)&&(r%2==0))
            t*=(r/2)+1;
           w++;}
          cout<<t;
    }
}
