import fractions,math,sys,collections
n = int(input())
s = input()
s = list(s)
cnt = collections.Counter(s)
for i in range(n):
    if s[i] == '.':
        cnt['.'] -= 1
    else:
        break
print(min(cnt['.'],cnt['#']))


