n = int(input())
s = input()

min = n

for i in range(n):
    bl = 0
    wr = 0
    for k in range(i):
        if s[k] == '#':
            bl = bl + 1

    for l in range(n - i - 1):
        if s[l + i + 1] == '.':
            wr = wr + 1

    if min > wr + bl:
        min = wr + bl


print(min)
