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

index = -1
flag = 0
for i, s in enumerate(S):
    if s == '.' and flag:
        idx = i - 1
        break
    if s == '#':
        flag = 1
        
if idx < 0:
    print(0)
    sys.exit()

S = S[idx:]
num_black = S.count('#')
num_white = S.count('.')
print(min([num_black, num_white]))