N = int(input())
S = input()
count = 0
replacingBlackCount = 0
replacingWhiteCount = 0

firstBlackPosition = S.find('#')
if firstBlackPosition < N - 1:
    replacingWhiteCount = S.count('.', firstBlackPosition + 1)

    replacingBlackCount = S.count('#', 0, N - 2)

count = min(replacingBlackCount, replacingWhiteCount)
print(count)
