 = int(input())
s = list(input())
cnt1 = 0
for i in range(n-1):
    if s[i] == '#' and s[i+1] == '.':
        cnt += 1
        s[i+1] = '#'

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


print(min(cnt1, cnt2))