n = int(input())
s = list(input())

l = []
string = s[0]
cnt = 0
for i in range(n):
    if string == s[i]:cnt +=1
    else:
        l.append((string, cnt))
        string, cnt = s[i], 1

l.append((string, cnt))
#print(l)
WorB = [0, 0]
dic = {'.':0, '#':1}
for i in range(len(l)):
    if i == 0 and l[0][0] == '.':continue
    if i == n - 1 and l[-1][0] == '#':continue
    temp, num = l[i]
    WorB[dic[temp]] += num

print(min(WorB))