while True: a,b=input().split() res=0 for x in b: if x==a.upper()or x==a.lower(): res+=1 print("{:.5f}".format(res/len(b)))