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

cb = 0
cw = 0

i = 0
while i < N-1:
    idx = i
    if S[i] == '#' and S[i+1] == '.':
        cb += 1
        i += 1
        j = 1
        while True:
            if idx + j + 1 < N and S[idx +1 +  j] == '.':
                j += 1
                cb += 1
                i += 1
            else:
                break
    i += 1
        
                
i = N-2
while i >= 0:
    idx = i
    if S[i] == '#' and S[i+1] == '.':
        cw += 1
        i -= 1
        j = 1
        while True:
            if idx - j >= 0 and S[idx - j] == '#':
                j += 1
                cw += 1
                i -= 1
            else:
                break
    i -= 1
print(min(cb,cw))
                