n = int(input())
s = list(input())
lis = []
rtmp = 0
ltmp = 0
tmp = 0
l,r = 0,0

for i in range(n-1):
    if (s[i] == '#' and s[i+1] == '.') or (s[i] == '.' and s[i+1] == '#'):
        #clis+= 1
        #print(i)
        rtmp = i+1
        ltmp = i
        for j in range(ltmp):
            if s[j] == '#':
                l += 1
        for j in range(rtmp,n):
            if s[j] == '.':
                r += 1
        lis.append(min(l,r))
        #print(lis)
    tmp = 0
    l,r = 0,0

if len(lis) == 0: 
    print(0)
else:
    print(min(lis))
