n = int(input())
s = list(input())
lis = []
rtmp = 0
ltmp = 0
tmp = 0
na = len(s)
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] == '#':
                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: 
    print(0)
else:
    print(min(lis))
