import sys

l = raw_input().split()
N = int(l[0])
l = raw_input().split()
S1 = list(l[0])

S = []
found = False
for s in S1:
    if s == '#':
        found = True
    if not found:
        continue
    S.append(s)

i = len(S) - 1
while i >= 0:
    if S[i] == '#':
        del S[i]
    else:
        break
    i -= 1
# print(S)
num_black = 0
num_white = 0

temp_black = 0
for s in S:
    if s == '#':
        temp_black += 1
    else:
        num_white += 1
        num_black += temp_black
        temp_black = 0

A = []
B = []
found_black = False
found_white = False
for i in range(len(S)):
    s = S[i]
    if s == '#':
        if found_white:
            B.append(A)
            found_white = False
            A = []
        A.append(s)
    else:
        A.append(s)
        found_white = True
    if i == len(S) - 1:
        B.append(A)

def count_num_black(S):
    count = 0
    for s in S:
        if s == '#':
            count += 1
    return count

num_black = count_num_black(B[0])
num_white = len(B[0]) - num_black
ret = min(num_black, num_white)
del B[0]
num_black = num_white = 0
for b in B:
    for a in b:
        if a == '#':
            num_black += 1
        else:
            num_white += 1

print(ret + min(num_black, num_white))
