user_input=[]
for i in range(2):
    user_input.append(input())
N=int(user_input[0])
S=user_input[1]

S_list=[]
for i in S:
    S_list.append(i)

num=0
for i in range(N-1):
    if S_list[i]=='#':
        if S_list[i+1]=='.':
            S_list[i+1]='#'
            num=num+1
print(num)