from collections import Counter
n = int(input())
s = list(input().rstrip())
c = Counter(s)
b = 0
w = c['.']
ans = w
for i in range(n):
    if s[i] == '#':
        b += 1
    else:
        w -= 1
    ans = min(ans, b + w)
print(ans)

a3bf294c54abbd8a9a7386ff99d8f7c73e3def48
<mask token>

<mask token>
for i in range(n):
    if s[i] == '#':
        b += 1
    else:
        w -= 1
    ans = min(ans, b + w)
print(ans)

<mask token>
n = int(input())
s = list(input().rstrip())
c = Counter(s)
b = 0
w = c['.']
ans = w
for i in range(n):
    if s[i] == '#':
        b += 1
    else:
        w -= 1
    ans = min(ans, b + w)
print(ans)

from collections import Counter
n = int(input())
s = list(input().rstrip())
c = Counter(s)
b = 0
w = c['.']
ans = w
for i in range(n):
    if s[i] == '#':
        b += 1
    else:
        w -= 1
    ans = min(ans, b + w)
print(ans)
