N = int(input())
S = input()
tmp = S.count('.')
tmp_1 = S.count('#')
if S[0] == '.':
    counter = 0
    count = 0
    while count < len(S) and S[count] != '#':
        counter += 1
        count += 1
    tmp -= counter 
if S[0] == '#':
    counter = 0
    count = 0
    while count < len(S) and S[count] != '.':
        counter += 1
        count += 1
    tmp_1 -= counter 
print(min(tmp, tmp_1))
