import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    N=int(input())
    S=list(input())
    cnt=0
    flag=False
    for i in range(N):
        if S[i]=='#':
            flag=True
        else:
            if flag==True:
                cnt+=1
                flag=False
    print(cnt)

resolve()