from sys import stdin
N = int(stdin.readline().rstrip())
S = list(stdin.readline().rstrip())

a=0
for i in range(len(S)-1):
    if (S[i]=='#') & (S[i+1]=='.'):
        S[i+1]='#'
        a += 1
print(a)
