a = input()

if(a[0] == 'A'):
    if(a[1] == '+'):
        print("4.3")
    elif(a[1] == '0'):
        print("4.0")
    elif(a[1] == '-'):
        print("3.7")
elif(a[0] == 'B'):
    if(a[1] == '+'):
        print("3.3")
    elif(a[1] == '0'):
        print("3.0")
    elif(a[1] == '-'):
        print("2.7")
elif(a[0] == 'C'):
    if(a[1] == '+'):
        print("2.3")
    elif(a[1] == '0'):
        print("2.0")
    elif(a[1] == '-'):
        print("1.7")
elif(a[0] == 'D'):
    if(a[1] == '+'):
        print("1.3")
    elif(a[1] == '0'):
        print("1.0")
    elif(a[1] == '-'):
        print("0.7")
else:
    print("0.0")





