N = int(input())
S = str(input())

ans = 2 * 10 ** 5
for i in range(len(S)):
    #print(S[:i], S[i:])
    sharp_num = S[i:].count('#') # 後ろを#→.
    dot_num = S[:i].count('.')
    ans = min(ans, dot_num + sharp_num)
print(ans)