N = int(input())
S = list(input())
count=0

if S[0]=='#':
    count+=1
    S[0] = '.'
for i in range(N-2):
    if S[i]=='#' and S[i+1]=='#' and S[i+2]=='.':
        S[i+2]='#'
        count+=1
    elif S[i]=='.' and S[i+1]=='#' and S[i+2]=='.':
        S[i+1]='.'
        count+=1
print(count)