N =int(input())
S = input()
 
s = list(S)
 
for i in range(N-1, -1, -1):
    if s[i] == "#":
        s[i] = ""
    else:
        break
    
for i in range(N):
    if s[i] == ".":
        s[i] = ""
    else:
        break
 
print(min(s.count("#"), s.count(".")))