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

# 最初の黒以降の白全部置き換える
ans1 = 0
found = False
for c in S:
    if c == '.' and found:
        ans1 += 1
    if c == '#':
        found = True

# 最後の白より前の黒を全部置き換える
ans2 = 0
found = False
for c in reversed(S):
    if c == '#' and found:
        ans2 += 1
    if c == '.':
        found = True

print(min(ans1, ans2))
