N = int(input())
S = input()
flag = False
ans = 10 ** 6
count = 0
#白を黒に
for c in S:
    if c == "#":
        flag = True
    
    if c == "." and flag:
        count += 1

ans = min(ans, count)

count = 0

flag = False
for i in range(N-1, -1, -1):
    if S[i] == ".":
        flag = True

    if S[i] == "#" and flag:
        count += 1
    
ans = min(ans, count)

print(ans)