N = int(input())
S = input()
w = S.count(".")
b = S.count("#")


ans = 0
while True:
    if "#." in S:
        ans += S.count("#.")
        S = S.replace("#.","")
    else:
        break
    #print(S2)
print(ans)