n=int(input())
s=str(input())
"""n = 8
s = "#.....#."
print(s)
print(len(s))"""

memo = []
countwb=0
now = s[0]
count = 0
if now == "#":
    memo.append(0)
while(count<n):
    if s[count]==now:
        countwb+=1
    else:
        memo.append(countwb)
        countwb = 1
        now = s[count]
    count+=1
memo.append(countwb)
#print(memo)
#print(memo[len(memo)-3])


count_b = []
c_b = 0
for  i in range(1,len(memo),2):
        c_b += memo[i]
        count_b.append(c_b)
#print(count_b)

count_w = []
c_w = 0
for  i in range(0,len(memo),2):
        c_w += memo[i]
        count_w.append(c_w)
#print(count_w)

#白白．．．黒黒にする
w_b = 0
if len(memo)%2==1:
    #最後が白
    w_b += memo[-1]
    if len(count_b)>1:
        w_b += count_b[-2]
else:
    #最後が黒
    if len(count_b)>1:
        w_b += count_b[-2]
#print("w_b",w_b)
#全部白にする
allw = count_b[-1]
#print("allw",allw)
#全部黒にする
allb = count_w[-1]
#print("allb",allb)

print(min(w_b,allb,allw))