g = int(input())
h = input()

count_list = []
min_count = g
for i in range(0, g+1):
    count = h[:i].count('#') + h[i:].count('.')
    if count == 0:
        break
    if min_count > count:
        min_count = count
print(count)
