N = int(input())
S = str(input())
 
 
S2 = S.split("#")[1:]
#print(S2)
if S2 == S:
        print("0")
else:
    sn = S2.count(".")
    if sn == 0:
        #print(S2[0])
        sn = S2[0].count(".")
    sn2 = S.count("#")
    #print(sn,sn2)
    sn3 = S.split(".")[-1]
    print(min(sn,sn2))