
def read_input():
    n = int(input())
    s = input().strip()

    return n, s


def split_sentence(s):
    temp = s[0]
    result = []

    for i in range(1, len(s)):
        if temp[-1] == '.' and s[i] == '#':
            result.append(temp)
            temp = s[i]
        else:
            temp += s[i]

    result.append(temp)

    return result


def count_white(t):
    return sum([1 for c in t if c == '.'])

def count_black(t):
    return sum([1 for c in t if c == '#'])

if __name__ == '__main__':
    n, s = read_input()

    min_c = n

    for i in range(n + 1):
        left = s[:i]
        right = s[i:]

        left_b = count_black(left)
        right_w = count_white(right)



        if left_b + right_w < min_c:
            min_c = left_b + right_w

    print(min_c)