There exist certain strings, known as $Unique$ $Strings$. They possess a unique property: 
- The character 'c' gets converted to "ff" and the character 'k' gets converted to "gg". Any letter besides 'c' and 'k' does not get converted to any other character.
Your job is to count the number of strings that could possibly be represented by a given unique string. Since the value could be very large, output the remainder when divided by $10^9+7$.
Note that if the given string is not a unique string, i.e. it contains either 'c' or 'k', output $0$.

-----Input:-----
- The first line of input contains a string, $s$.

-----Output:-----
- Output in a single line the possible number of strings modulo $10^9+7$.

-----Constraints-----
- $1 \leq |s| \leq 10^5$
where |s| denotes length of string.

-----Sample Input 1:-----
thing

-----Sample Input 2:-----
ggdffn

-----Sample Input 3:-----
fff

-----Sample Input 4:-----
cat

-----Sample Output 1:-----
1

-----Sample Output 2:-----
4

-----Sample Output 3:-----
3

-----Sample Output 4:-----
0

-----EXPLANATION:-----
The possible strings that can be represented by the given string in each of the examples are as follows:
$1)$ 'thing'
$2)$ 'ggdffn','kdffn','ggdcn','kdcn'
$3)$ 'fff','cf','fc'
$4)$ Since the string 'cat' contains 'c', it is certain that this string is not a unique string. Hence, the output is $0$.

Difficulty: interview

Starter code:

Solutions:
tb=str(input())
tb=list(tb)
if("c" in tb or "k" in tb):
 print(0)
else:
 ans=1
 i=0
 while(i<len(tb)):
  if(tb[i]=="g" or tb[i]=="f"):
   my=tb[i]
   i+=1
   ct=1
   while(i<len(tb) and tb[i]==my):
    ct+=1
    i+=1
   if(ct>3):
    ct+=1
   ans*=ct
  else:
   i+=1
 print(ans)

from itertools import combinations as cb

s = input()
s = list(s)
if('c' in s or 'k' in s):
 print('0')
else:
 nf = []
 nk =[]
 i =0
 while i<len(s)-1:
  if(s[i]=='f'):
   j=i+1
   p=1
   k =1
   while j<len(s) and p:
    if(s[j]=='f'):
     k+=1
     j +=1
    else:
     p=0
   nf.append(k) 
   i = j
  elif(s[i]=='g'):
   j = i+1
   p=1
   k=1
   while j<len(s) and p:
    if(s[j]=='g'):
     k+=1
     j+=1
    else:
     p=0
     
   nk.append(k)
   i = j
  else:
   i+=1

 
 p=1
 for i in nf:
  n = i
  if(n>=2):
   k=0
   for j in range(1,n+1):
    a = (n//j) -1
    k +=a
   k+=1
   p *=k
 for i in nk:
  n = i
  if(n>=2):
   k=0
   for j in range(1,n+1):
    a = (n//j) -1
    k +=a
   k+=1
   p *=k
 if(nf!=[] and nk!=[]):
  if(len(s)==nf[0] or len(s)==nk[0]):
   count =p-1
  else:
   count =p
 elif(nf==[] and nk!=[]):
  if( len(s)==nk[0]):
   count =p-1
  else:
   count =p
 elif(nf!=[] and nk==[]):
  if(len(s)==nf[0]):
   count =p-1
  else:
   count =p
 else:
  count =1
 print(count%1000000007)

try:
 def find(l):
  f=0
  for i in range(len(l)-1):
   if(l[i]=='f' and l[i+1]=='f'):
    f+=find(l[i+1:])
    f+=find(l[i+2:])
    break
   if(l[i]=='g' and l[i+1]=='g'):
    f+=find(l[i+1:])
    f+=find(l[i+2:])
    break
  if(f==0):
   return f+1
  return f
 l=list(input())
 if(l.count('c')>0 or l.count('k')>0):
  print("0")
 else:
  print(find(l))
except EOFError as e:
 pass

mod=10**9+7
fib=[1,1]
for i in range(10**5+4):
 fib.append((fib[-1]+fib[-2])%mod)
s=input()
if 'c' in s or 'k' in s:
 print(0)
 return
n=len(s)
l=[]
i=0
while i<n:
 if s[i]=='f':
  c=0
  while i<n and s[i]=='f':
   c+=1
   i+=1
  l.append(fib[c])
 elif s[i]=='g':
  c=0
  while i<n and s[i]=='g':
   c+=1
   i+=1
  l.append(fib[c])
 else:
  i+=1
if len(l)==0:
 print(1)
 return
ans=l[0]
for i in range(1,len(l)):
 ans=(ans*l[i])%mod
print(ans)

from math import factorial

def rle(s):
 if not s:
  return []
 last = s[0]
 count = 0
 for curr in s:
  if last == curr:
   count += 1
  else:
   yield (last, count)
   count = 1
   last = curr
 else:
  yield (last, count)
  
def algo(n):
 ans = 0
 for repl_length in range(0, n + 1, 2):
  n_fs = n - repl_length
  n_cs = repl_length >> 1
  ans += factorial(n_fs + n_cs) // (factorial(n_fs) * factorial(n_cs))
 return ans

s = input()
ans = 1
for (char, count) in rle(s):
 if char in 'gf':
  ans *= algo(count)
print(ans)

from functools import lru_cache


def rle(s):
 if not s:
  return []
 last = s[0]
 count = 0
 for curr in s:
  if last == curr:
   count += 1
  else:
   yield (last, count)
   count = 1
   last = curr
 else:
  yield (last, count)


@lru_cache(maxsize=None)
def fact(n):
 if n < 3:
  return max(1, n)
 return n * fact(n - 1)


def comb_count(n):
 ans = 0
 for repl_length in range(0, n + 1, 2):
  n_fs = n - repl_length
  n_cs = repl_length >> 1
  ans += fact(n_fs + n_cs) // (fact(n_fs) * fact(n_cs))
 return ans


s = input()
ans = 1
if 'c' not in s and 'k' not in s:
 for (char, count) in rle(s):
  if char in 'gf':
   ans *= comb_count(count)
 print(ans)
else:
 print(0)

from functools import lru_cache


def rle(s):
 if not s:
  return s
 last = s[0]
 ans = []
 count = 1
 for curr in s[1:]:
  if last != curr:
   ans.append((last, count))
   count = 1
   last = curr
  else:
   count += 1
 else:
  ans.append((last, count))
 return ans


@lru_cache(maxsize=None)
def fact(n):
 if n < 3:
  return max(1, n)
 return n * fact(n - 1)


def comb_count(n):
 ans = 0
 for repl_length in range(0, n + 1, 2):
  n_fs = n - repl_length
  n_cs = repl_length >> 1
  ans += fact(n_fs + n_cs) // (fact(n_fs) * fact(n_cs))
 return ans


s = input()
ans = 1
if 'c' not in s and 'k' not in s:
 for (char, count) in rle(s):
  if char in 'gf':
   ans *= comb_count(count)
 print(ans)
else:
 print(0)

# cook your dish here
def f(n):
 count = 1
 if n%2==0:
  for i in range(1,n//2+1):
   if i==n//2:
    count+=1
   else:
    count+=n-i
  return count
 else:
  for i in range(1,n//2+1):
   count+=n-i
  return count
 
 
s = input()
c,count = 1,0
lst = []
if 'c' in s or 'k' in s:
 print(0)
 return
for i in range(len(s)-1):
 if s[i]==s[i+1]=='g':
  count+=1
 elif s[i]==s[i+1]=='f':
  count+=1
 else:
  if count:
   lst.append(count+1)
   count = 0
if count:
 lst.append(count+1)
#print(lst)
for i in lst:
 c = c*(f(i))
 #print(f(i))
print(c)

def fib(n): 
  
 F = [[1, 1], 
   [1, 0]] 
 if (n == 0): 
  return 0
 power(F, n - 1) 
   
 return F[0][0] 
  
def multiply(F, M): 
  
 x = (F[0][0] * M[0][0] + 
   F[0][1] * M[1][0]) 
 y = (F[0][0] * M[0][1] + 
   F[0][1] * M[1][1]) 
 z = (F[1][0] * M[0][0] + 
   F[1][1] * M[1][0]) 
 w = (F[1][0] * M[0][1] + 
   F[1][1] * M[1][1]) 
  
 F[0][0] = x 
 F[0][1] = y 
 F[1][0] = z 
 F[1][1] = w 
   
# Optimized version of 
# power() in method 4  
def power(F, n): 
 
 if( n == 0 or n == 1): 
  return; 
 M = [[1, 1], 
   [1, 0]]; 
   
 power(F, n // 2) 
 multiply(F, F) 
   
 if (n % 2 != 0): 
  multiply(F, M)

s=input()
nr=len(s)
M=1000000007
cnt=1
i=0
while(i<nr):
 if(s[i]=="c" or s[i]=="k"):
  cnt=0
  break
 elif(s[i]=="g"):
  val=1
  i+=1
  while(i<nr and s[i]=="g"):
   i+=1
   val+=1
  if(val==1):
   cnt=cnt
  elif(val==2):
   cnt=(cnt*2)%M
  else:
   val=fib(val+1)
   cnt=(cnt*val)%M
 elif(s[i]=="f"):
  val=1
  i+=1
  while(i<nr and s[i]=="f"):
   i+=1
   val+=1
  if(val==1):
   cnt=cnt
  elif(val==2):
   cnt=(cnt*2)%M
  else:
   val=fib(val+1)
   cnt=(cnt*val)%M
 else:
  i+=1
print(cnt)

import random
import time


def get_input():
 # _ = int(input())
 inp_str = input()
 return inp_str


def get_nth_fibbo(n):
 a = 0
 b = 1
 # ndash = n
 while n > 0:
  a, b = b, a+b
  n -= 1
 # print(ndash, b)
 return b


def count_unique(inp_str):
 unique_count = 1
 if "c" in inp_str or "x" in inp_str:
  return 0
 count_arr = []
 cur_chr = None
 cur_chr_len = 0
 for char in inp_str:
  if cur_chr is None:
   cur_chr = char
   cur_chr_len = 1
   continue
  if char == cur_chr:
   cur_chr_len += 1
  else:
   if cur_chr in ["f", "g"]:
    count_arr.append(cur_chr_len)
   cur_chr = char
   cur_chr_len = 1
 if cur_chr in ["f", "g"]:
  count_arr.append(cur_chr_len)
 # print(count_arr)
 for count in count_arr:
  unique_count *= get_nth_fibbo(count)
 return unique_count


def test():
 n = random.randint(5, 10)
 ord_a = ord("e")
 ord_z = ord("h") + 1
 inp_str = "".join([
  chr(random.randrange(ord_a, ord_z))
  for _ in range(n)
 ])
 unique_count = count_unique(inp_str) % (10 ** 9 + 7)
 if unique_count > 10:
  print("Input: {}".format(inp_str))
  print("Unique: {}".format(unique_count))
  time.sleep(2)


def stress_test():
 while True:
  test()


def main():
 inp_str = get_input()
 r = count_unique(inp_str) % (10 ** 9 + 7)
 print(r)


def __starting_point():
 # stress_test()
 # test()
 main()

'''
fffff
cfff
ccf
cfc
fcff
fcc
ffcf
fffc

'''

__starting_point()

# cook your dish here
s = input()
if('c' in s or 'k' in s):
 print(0)
else:
 l1 = []
 pre = s[0]
 count = 1
 for i in s[1:]:
  if pre == i and i in 'gf':
   count +=1
  else:
   if count!=1:
    l1.append(count)
   count = 1
  pre = i
 if(count > 1):
  l1.append(count)
 ##print(l1)
 ans = 1
 for t in l1:
  ans*= (t*t - 3*t + 6)/2
 print(int(ans))

# cook your dish here
s=input()
dp=[1,1]
cant=False
if "c" in s or "k" in s:
 cant=True
for i in range(1,len(s)):
 if s[i]+s[i-1]=="gg" or s[i]+s[i-1]=="ff":
  dp.append(dp[-1]+dp[-2])
 else:
  dp.append(dp[-1])
 #print(s[i],dp[-1])
if cant:
 print(0)
else:
 print(dp[-1]%(10**9+7))