import math
N = int(input())
S = input()
for i in range(N-1):
    if S[i] == "." and S[i+1] == "#":
        break
sharp_count = 0
for j in range(i+1,N):
    if S[j] == "#":
        sharp_count += 1

for i in range(N-1):
    index = N-i
    if S[i] == "#" and S[i-1] == ".":
        break
dot_count = 0
for j in range(index):
    if S[j] == ".":
        dot_count += 1
print(min(sharp_count,dot_count))