n = int(input())
s = input()
end = len(s) -1

s1 = s[:]
i = 0
ans1 = 0
while(i < end):
    c = s1[i] + s1[i+1]
    if c == '#.':
        s1 = s1[:i] + '.' + s1[i+1:]
        ans1 = ans1+ 1
    i += 1

s2 = s[:]
i = 1
end = len(s)
ans2 = 0
while(i < end):
    c = s2[i-1] + s2[i]
    if c == '#.':
        s1 = s1[:i-1] + '#' + s1[i:]
        ans2 = ans2 + 1
    i += 1


if ans1 <= ans2:
    print(ans1)
else:
    print(ans2)
