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

count = 0

for i in range(1,n):
    if s[-i] == '#':
        count += 1
    else:
        break

s = s[:n-count]
sharp_num = s.count('#')
dot_num = s.count('.')

print(min(sharp_num,dot_num))