n = int(input())
s = input()
flag = 0
location1 = 0
location2 = 0
for i in range(n):
    if s[i] == '#':
        location1 = i
        flag = 1
        break

count1 = s[location1:n].count('.')

s = s[::-1]
i = 0

for i in range(n):
    if s[i] == '.':
        location2 = i
        flag = 1
        break

count2 = s[location2:n].count('#')

if flag == 0:
    print(0)
else:
    print(min(count1, count2))
