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

s1 = s.count(".")
s2 = s.count("#")

print(min(s1, s2))