def main():
    n = int(input())
    s = input()
    ans = 10**10
    for i in range(n):
        lc = s[:i+1].count(".")
        rc = s[i:].count("#")
        tmp = n - lc - rc
        if tmp < ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()
