n = int(input())
s = input()
s = 's' + s + 'e'

min_count = n
for i in range(1, n):
    if s[i-1] != s[i]:
        count = s[:i].count('#') + s[i:].count('.')
        if min_count > count:
            min_count = count

print(min_count)
