n = int(input())
s = input()

count_w = 0
count_b = 0
s2=''

for i, wb in enumerate(s):
    if i != (n-1):
        if wb == '#':
            s2 = s[i:]
            break

count_w = s2.count('.')
count_b = s.count('#')

print(min(count_w, count_b))