# https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_c

from copy import deepcopy
n = int(input())
s = list(input())
t = deepcopy(s)
t1 = 0
for i in range(n - 1):
    if s[i] == '#' and s[i + 1] == '.':
        t1 += 1
        s[i + 1] = '#'

t2 = 0
for i in range(n - 1)[::-1]:
    if t[i] == '#' and t[i + 1] == '.':
        t2 += 1
        t[i] = '.'
ans = min(t1, t2)
print(ans)