n = int(input())
s = input()
cw = 0
cb = 0
flag = False
a = -1
b = 0
for i in range(n):
    if s[i] == ".":
        cw += 1
    else:
        if flag == False:
            a = i
            flag = True
        cb += 1
if s[-1] == ".":
    b = 1
print(min(min(cb,cw),cw-a))
