n = int(input())
st = input()
i = 0
b = 0
w = 0
ans = []
a = 0

for i in range(n + 1):
    for j, s in enumerate(st):
        if i <= j and s == '.':
            a += 1
        elif i > j and s == '#':
            a += 1

    ans.append(a)
    a = 0

print(min(ans))