def MI(): return map(int, input().split())
def II(): return int(input())
def IS(): return input()
def LI(): return list(map(int, input().split()))


n = II()
s = list(IS())
count = 0
if len(s) == 1:
    print(0)
    exit()
for i in range(len(s)):
    if i == 0 and s[i] == '#' and s[i+1] == '.':
        s[i] = '.'
        count += 1
    elif i == len(s)-1:
        break
    elif s[i-1] == '.' and s[i] == '#' and s[i+1] == '.':
        count += 1
        s[i] = '.'
    elif s[i-1] == '#' and s[i] == '#' and s[i+1] == '.':
        count += 1
        s[i+1] = '#'
print(count)
