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

idx = -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:]

if S[-1] == '#':
    idx = 0
    for i in range(len(S)):
        if S[-(i + 1)] == '#':
            continue
        idx = i
        break
    if idx == 0:
        print(0)
        sys.exit()
    S = S[: -idx]
    

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