import sys

def main():
    N = int(input())
    S = input()
    ans = 0
    for i in range(N-1):
        if S[i:i+2]=='#.':
            if (i-1)>=0 and (i+2)<N and S[i-1]=='#' and S[i+2]=='.':
                S = S[:i+1] + '#' + S[i+2:]
                ans += 1
            else:
                ans += 1

            # if i==0 or ((i-1)>=0 and S[i-1]=='.'):
            #     # S = S[:i] + '.' + S[i+1:]
            #     ans += 1
            # elif i+1==N-1 or ((i+2)<N and S[i+2]=='#'):
            #     ans += 1
            # else:
            #     S = S[:i+1] + '#' + S[i+2:]
            #     ans += 1
    print(ans)

if __name__ == '__main__':
    main()
