def chec(s):
    lis = []
    rtmp = 0
    ltmp = 0
    tmp = 0
    na = len(s)
    for i in reversed(range(0,na-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] == '#':
                    tmp += 1
            for j in range(rtmp,na):
                if s[j] == '.':
                    tmp += 1
            lis.append(tmp)
        rtmp = 0
        ltmp = 0
        tmp = 0
    
    if len(lis) == 0: 
        return 0
    else:
        return min(lis)

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