stp = int(input()); s = [j for j in input()]; cut = ['#','.']
b,ans= [],0; ass = 0 if s.count('.') < s.count('#') else 1
for x,y in enumerate(s):
    if y == '#': b.append(x)
for i in reversed(b):
    if i+1 < stp: 
        if s[i+1] == '.': ans += 1; s[i] = cut[ass]
print(ans)