N = int(input())
S = input().rstrip('#').lstrip('.')
#intS = []
def xor(A,B):
    #print(A)
    #print(B)
    num = 0
    for i in range(len(A)):
        
        if A[i]!=B[i] :
            num = num + 1
    return num
# for s in S :
#     intS.append(0 if s=='.' else 1)
minC = N

mask = ['#' for j in range(len(S) + 1)]
for i in range(len(S) + 1):
    mask[i] = '.'
    c = xor(mask[1::],S)
    if c < minC:
        minC = c

print(minC)
# def dl(_S):
    

#     l = '.'
#     r = '#'
    
#     _S = _S.lstrip(l).rstrip(r)
#     print(_S)
#     if len(_S) == 0:
#         return 0
#     _S2W = _S.lstrip(r)
#     _S2B = _S.rstrip(l)
#     _S2 =  _S2W if len(_S2W) <= len(_S2B) else _S2B
#     return len(_S) - len(_S2) + dl(_S2)
# print(dl(S))




