N = int(input())
S = input()

l = 0
for i, s in enumerate(S):
    if s == '#':
        l = i
        break

r = len(S)
for i, s in enumerate(reversed(S)):
    if s == '.':
        r = len(S) - i
        break

count_b = 0
count_w = 0
for i, s in enumerate(S[l:r]):
    if s == '#':
        count_b += 1
    else:
        count_w += 1

ans = min(count_b, count_w)

print(ans)