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