n = int(eval(input()))

s = eval(input())

ans = s.count('.')

num = ans

for c in s:

  if c == '.':

    num -= 1

  else:

    num += 1

  

  ans = min(ans,num)



print(ans)



def main():

    N=int(eval(input()))

    line = list(eval(input()))

    ans= line.count(".")

    num = ans

    for i in line:

        if i ==".":

            num -=1

        else:

            num +=1

        ans = min(ans,num)



    return ans





print((main()))
n = int(eval(input()))
s = eval(input())
ans = s.count(".")
num = ans
for c in s:
    if c == ".":
        num -= 1
    else:
        num += 1
    ans = min(ans, num)
print(ans)

def main():
    N = int(eval(input()))
    line = list(eval(input()))
    ans = line.count(".")
    num = ans
    for i in line:
        if i == ".":
            num -= 1
        else:
            num += 1
        ans = min(ans, num)
    return ans


print((main()))

-n = int(eval(input())) -s = eval(input()) -ans = s.count(".") -num = ans -for c in s: -    if c == ".": -        num -= 1 -    else: -        num += 1 -    ans = min(ans, num) -print(ans) +def main(): +    N = int(eval(input())) +    line = list(eval(input())) +    ans = line.count(".") +    num = ans +    for i in line: +        if i == ".": +            num -= 1 +        else: +            num += 1 +        ans = min(ans, num) +    return ans + + +print((main()))