import copy
n = int(input())
s0 = list(input())
s1 = copy.deepcopy(s0)
ans0, ans1 = 0, 0
for i in range(n-1, 0, -1):
    if s0[i] == '.' and s0[i-1] == '#':
        ans0 += 1
        s0[i] = '#'

for i in range(n-1, 0, -1):
    if s1[i] == '.' and s1[i-1] == '#':
        ans1 += 1
        s1[i-1] = '.'

print(min(ans0, ans1))
