def main():
    _ = int(input())
    S = input()
    w = S.count('.')
    b = S.count('#')
    ans = float('INF')
    for i in range(len(S) - 1):
        lb = S[:i].count('#')
        rw = S[i + 1:].count('.')
        ans = min(w, b, lb + rw, ans)
    print(ans)


main()
