N = int(input())
S = input()

li = list(S)
count = 0

if S.count('.') > S.count('#'):
    for i in range(1, N):
        idx = -1 * i
        if '.' == li[idx] and '#' == li[idx-1]:
            li[idx-1] = '.'
            count += 1
else:
    for i in range(1, N):
        idx = -1 * i
        if '.' == li[idx] and '#' == li[idx-1]:
            li[idx] = '#'
            count += 1
print(count)
