data = input().split(' ') if 'Sun' in data and 'Sat' in data: print(8/33) elif 'Sun' in data or 'Sat' in data: print(8/32) else: print(8/31)