# -*- coding: utf-8 -*-
N = int(input())
S = list(input())

BLACK = '#'
WHITE = '.'

count = 0
for idx in range(N - 1):
    if S[idx] == BLACK and S[idx + 1] == WHITE:
        if idx > 0 and S[idx - 1] == WHITE:
            S[idx] = WHITE
        else:
            S[idx + 1] = BLACK
        count += 1

print(count)