import sys input = sys.stdin.readline S=input().strip() lo=0 sa=0 for s in S: if s in 'lo': lo+=1 elif s in 'as': sa+=1 ans=(2**lo-1)*(2**sa-1) if lo+sa==8: ans-=1 print(max(0,ans))