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

ans = 0
for i, s in enumerate(S):
    if i == N-1:
        break
    if s is '#':
        ans__ = 0
        flag = -1
        count = i
        for s_ in S[count+1:]:
            if count + 1 == N or s_ is '#':
                break
            if s_ is '.' :
                flag = 1
                ans__ += 1
        if flag == 1:
            ans_ = 1
            c = i
            while c >= 1:
                if S[c-1] is '#':
                    ans_ += 1
                c -= 1
            ans += min(ans_, ans__)

print(ans)
