N = int (input ())
S = str (input ())
 
def dot_num ():
    cnt = 0
    for i in range (N):
        if S [i] == '.':
            cnt += 1
    return cnt
 
def hash_num ():
    cnt = 0
    for i in range (N):
        if S [i] == '#':
            cnt += 1
    return cnt
 
dots = dot_num ()
hashes = hash_num ()
 
if S [0] == '.':
    dots -= 1
 
if S [N-1] == '#':
    hashes -= 1
    
print (min (dots, hashes))