// Arup Guha
// 2/14/2024
// Solution to Kattis Problem: Dobra
// https://open.kattis.com/problems/dobra
// Used as RP2 for COP 3503 in Spring 2024

import java.util.*;

public class dobra {
	
	final public static String VOWELS = "AEIOU";
	public static boolean[] isvowel;
	final public static int NUMC_NOL = 20;
	final public static int NUMV = 5;
	
	public static char[] word;
	public static int n;
	
	public static void main(String[] args) {
	
		// Set up vowel look up.
		isvowel = new boolean[26];
		for (int i=0; i<VOWELS.length(); i++)
			isvowel[VOWELS.charAt(i)-'A'] = true;

		// Get input.
		Scanner stdin = new Scanner(System.in);
		word = stdin.next().toCharArray();
		n = word.length;
		
		// Solve it.
		long res = go(0, false);
		System.out.println(res);
	}
	
	// Returns # of solutions where first k slot are filled and hasL is true iff
	// we've already placed an L.
	public static long go(int k, boolean hasL) {
		
		// Stop if the last three are all vowels or consonants.
		if (sameLastThree(k-1)) return 0;
		
		// Made it to the end.
		if (k == n) 
			return hasL ? 1 : 0;
		
		// Forced letter, continue the recursion.
		if (word[k] != '_') 
			return go(k+1, hasL || word[k] == 'L');
		
		// The possible items I can place in a blank and how many of
		// each category there are.
		char[] choices = {'A','B','L'};
		long res = 0;
		int[] numOptions = {NUMV, NUMC_NOL, 1};
		
		// Try each option and add the results.
		for (int i=0; i<choices.length; i++) {
			
			// Try this choices in the blank.
			word[k] = choices[i];
		
			// This is tricky. If I put an L in, hasL changes...
			long call = (i == 2)? go(k+1, true) : go(k+1, hasL);
			
			// Add these in.
			res += numOptions[i]*call;
			
			// Clear it.
			word[k] = '_';
		}
		
		// Ta da.
		return res;
	}
	
	// Returns true iff word[lastI-2..lastI] are all the same "type".
	public static boolean sameLastThree(int lastI) {
		
		// Avoid array out of bounds.
		if (lastI < 2) return false;
		
		// Check all vowels.
		boolean allV = true;
		for (int i=lastI; i>lastI-3; i--) allV = allV && charIsVowel(word[i]);
		
		// Check all consonants.
		boolean allC = true;
		for (int i=lastI; i>lastI-3; i--) allC = allC && charIsConsonant(word[i]);
		
		// Ta da!
		return allV || allC;
	}
	
	// Function that returns true iff c is an uppercase vowel.
	public static boolean charIsVowel(char c) {
		if (c < 'A' || c > 'Z') return false;
		return isvowel[c-'A'];
	}
	
	// Function that returns true iff c is an uppercase consonant.
	public static boolean charIsConsonant(char c) {
		if (c < 'A' || c > 'Z') return false;
		return !isvowel[c-'A'];
	}
}