N=int(input())
S=list(input())
counter=0
for i in range(N-1):
    if S[i - 1] == '#' and S[i]=='#' and S[i + 1]=='.':
        S[i + 1] = '#'
        counter += 1
    elif S[i - 1] == '.' and S[i]=='#' and S[i + 1]=='.':
        S[i] = '.'
        counter += 1
print(counter)