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

ans = 0

if len(S) == 1:
    print(ans)
elif len(S) == 2:
    if S == ['#', '.']:
        print("1")
    else:
        print("0")
else:
    for i in range(len(S)-2):
        if S[i] == '#' and S[i+1] == '.':
            if S[i+2] == '.':
                S[i] = '.'
            else:
                S[i+1] = '#'
            ans += 1
    if S[-2:] == ['#', '.']:
        ans += 1
    print(ans)
       
