n = int(input())
s = input().strip()
s = list(s)

dp_dot = [0 for i in range(n)]
dp_hash = [0 for i in range(n)]

for i in range(1,n):
    if s[i]=='#':
        dp_hash[i] = min(dp_hash[i-1], dp_dot[i-1]) + 1
        dp_dot[i] = dp_dot[i-1]
    else:
        dp_dot[i] = min(dp_hash[i-1], dp_dot[i-1]) + 1
        dp_hash[i] = dp_hash[i-1]

print(min(dp_hash[n-1], dp_dot[n-1]))        