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

prev = '.'
ans = 0

for i, s in enumerate(S):
    if s == '.' and prev == '#':
        ans += 1
    if prev == '.' and s == '#':
        prev = '#'

count_b = 0
for i, s in enumerate(S):
    if s == '#':
        count_b += 1

ans = min(count_b, ans)
print(ans)