n = int(input())
s = input()
lis = []
ws=s.count('.')
lis.append(ws)
bs = 0
for x in s:
    if x == '#':
        bs += 1
        lis.append(bs+ws)
    else:
        ws -= 1
lis.append(bs+ws)
print(min(lis))
