N = int(input())
S = str(input())
l = [1]
flg = S[0]
index = 1
#文字列分割が謎
while index != len(S):
    if S[index] == flg:
        l[len(l)-1] += 1
    else:
        l.append(1)
        flg = S[index]
    index += 1
if len(l) == 1:
    print(0)
elif len(l) == 2:
    if S[0] == ".":
        print(0)
    else:
        print(min(l[0],l[1]))
else:
    if S[0] == ".":
        l[0] = 0
    if S[len(S)-1] == "#":
        l[len(l)-1] = 0
    a = 0
    b = 0
    k = 0
    while k+1 < len(l):
        a += l[k]
        b += l[k+1]
        k += 2
    if k == len(l) - 1:
        a += l[k]
    print(min(a,b))