sep_first,sep_second = map(str,input().split()) if sep_first == "Sat" or sep_first == "Sun": if sep_second == "Sun" or sep_second == "Sat": print(8/32) else: print(8/33)