n = int(input())
s = input()
d = []
for c in s:
    if d==[]:
        d.append([c,1])
    else:
        if c == d[-1][0]:
            d[-1][1]+=1
        else:
            d.append([c,1])

endwhite = 0
endblack = 0
white = 0
black = 0
total = 0
for p in d:
    if p[0] == '.':
        endwhite = black
        endblack += p[1]
        white += p[1]
    if p[0] == '#':
        endblack = white
        endwhite += p[1]
        black += p[1]
print(min(endwhite,endblack))
