n = int(input())
s = input()
ne = []
for i in s:
    ne.append(i)

ans = 0
ans2 = 0
for i in range(n-1,1,-1):
    if ne[i] == '.' and ne[i-1] == '#':
        ne[i-1] = '.'
        ans += 1
ne = []
for i in s:
    ne.append(i)
for i in range(n-1):
    if ne[i] == '#' and ne[i+1] == '.':
        ne[i+1] = '#'
        ans2 += 1

print(min(ans,ans2))