import java.util.Scanner;
public class Di {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String n =sc.next();
System.out.println(new Di().go(n));
}
public int c(){return 10;}
public int e(){return 5;}
public int f(){return 6;}
public int go(String x){
if(x.equals("E"))
{ return this.e();}
else if(x.equals("F"))
{ return this.f();}
else if(x.equals("C"))
{ return this.c();}
else if(x.equals("D"))
{ return this.e()+this.f();}
else if(x.equals("B"))
{ return this.go("D")/this.go("E");}
else if(x.equals("A"))
{ return this.go("D")+this.go("B")+this.go("E");}
return 0;
}
}
double getValue(char c) {
switch (c) {
case 'A': return getValue("B") + getValue("D") + getValue("E");
case 'B': return getValue("D")/ getValue("E");
case 'C': 10;
case 'D': getValue("E") + getValue("F");
case 'E': 5;
case 'F': 6;
default : return 1;
}
}
public static double sum(char d){ switch (d){ case 'A': return sum('B')+sum('D')+sum('E'); case 'B': return sum('D')/sum('E'); case 'C': return 10.0; case 'D': return sum('E')+sum('F'); case 'E': return 5.0; case 'F': return 6.0; default: System.out.println("error"); System.exit(1); return -1; } } //所求函数