N = int(input())
S = input()

cnt=0
l = []
b = 1 if S[0] == "." else 0

for i in range(1, N):
    if S[i]==S[i-1]:
        cnt += 1
        if i == N-1:
            l.append(cnt+1)
    else:
        l.append(cnt+1)
        if i == N-1:
            l.append(1)
        cnt = 0

if len(l)<=1:
    print("0")
    exit()

s = 0

for j in range(abs(b-1), len(l), 2):
    #print(j, l[j])
    s += l[j]

m = s
#print(s)
for j in range(b, len(l), 2):
    #print(j-2,l[j-2], j-1, l[j-1])
    if j-2 >= 0:
        s += l[j-2]-l[j-1]
    elif j-1 >= 0:
        s += -l[j-1]
    m = min(s, m)


#print(l)
print(m)