from collections import Counter

def main():
    _ = int(input()) ###
    S = list(input())

    # C = Counter(S)

    result = 10000
    for i in range(1, len(S)+1):
        left, right = Counter(S[:i]), Counter(S[i:])
        count_sharp = left['#']
        count_dot = right['.']

        total = count_sharp + count_dot
        # print(left, right, count_sharp,count_dot, total)
        result = min(result, total)
    print(result)

main()