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

BKList = [i for i in range(N) if S[i] == '#']
if BKList != []:
    idx = min(BKList)
    BK = S[idx + 1:].count('.')
else:
    BK = 0

WHList = [i for i in range(N) if S[i] == '.']
if WHList != []:
    idx = max(WHList)
    WH = S[:idx].count('#')
else:
    WH = 0
print(min(BK, WH))