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

m = ['#', '.']
m1 = ['#', '.', '#']
m2 = ['#', '.', '.']
m3 = ['#', '#', '.']
m4 = ['.', '#', '.']


def matching():
    count = 0
    non_count = 0
    for i in range(N):
        if S[i:i+2] != m:
            non_count += 1
            continue

        flag = True
        if i>=0 and i<= N-3:
            if S[i:i+3] == m1:
                count +=1
                S[i] = '.'
                flag = False
            elif S[i:i+3] == m2:
                count += 1
                S[i] = '.'
                flag = False
        if flag == False or i==0:
            continue


        if S[i-1:i+2] == m3:
            S[i+1] = '#'
            count += 1
        elif S[i-1:i+2] == m4:
            S[i] = '.'
            count += 1
    return count, non_count

c = 0
non = -1
while(non!=N):
    c_m, non = matching()
    c += c_m

print(c)
