import sys,copy
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float('inf')
MOD = 10**9+7
dy = [0,1,0,-1]
dx = [1,0,-1,0]
ddy = [0,1,1,1,0,-1,-1,-1]
ddx = [1,1,0,-1,-1,-1,0,1]

n = int(input())
S = input()
W = [0]*(2*10**5+1)
B = [0]*(2*10**5+1)
for i in range(n):
    if S[i] == '.':
        W[i] = 1
    else:
        B[i] = 1
for i in range(1,2*10**5+1):
    W[i] += W[i-1]
    B[i] += B[i-1]
res = INF
for i in range(2*10**5+1):
    ans = W[-1]-W[i]+B[i]
    if ans <= res:
        res = ans
print(res)