n = int(input())
s = input()
# 全部白か黒

if s[-1] == ".":
    s += "#"

li = []
li2 = []
tmp = 0
tmp2 = 0
for i in s:
    if i == "#":
        tmp += 1
    else:
        li.append(tmp)
        tmp = 0

for i in s:
    if i == ".":
        tmp2 += 1
    else:
        li2.append(tmp2)
        tmp2 = 0

#print(list(filter(lambda a: a != 0, li)))
#print(list(filter(lambda a: a != 0, li2)))
#print(li)
#print(li2)
li = list(filter(lambda a: a != 0, li))
li2 = list(filter(lambda a: a != 0, li2))
#print(li)
#print(li2)

try:
    a = li[0] + sum(li2[1:])
except:
    a = 100000000000000
b = sum(li)# 全部白
c = sum(li2)# 全部黒
print(min(a, b, c))
