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

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

def check(i):
    global S
    if S[i-1:i+1] == m:
        matching(i-1)


def matching(i):
    global S, count
    if S[i:i+2] != m:
        return

    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:
        check(i)
        return

    if i==0: return

    if S[i-1:i+2] == m3:
        S[i+1] = '#'
        count += 1
    elif S[i-1:i+2] == m4:
        S[i] = '.'
        count += 1
    check(i)

count = 0


for i in range(N):
    matching(i)

print(count)
