def main():
    n = int(input())
    s = input()
    black = s.count("#")
    ans, white = black, 0
    for i in range(n):
        if s[i] == ".":
            white += 1
        else:
            black -= 1
        tmp = n - black - white
        if tmp < ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()
