n = int(input())
s = input()

def counting_distance(s1, s2):
    count = 0
    for i in range(len(s1)):
        if s1[i] != s2[i]:
            count += 1
    return count

count_list = []

black = 0
white = s.count('.')

for i in range(n):
    if s[i] == '#':
        black += 1
    if s[i] == '.':
        white += 1
    count_list.append(black + white)

print(min(count_list))