import sys
N = int(input())
S = input()
s_list = list(S)
temp_start = temp_end = N+1
count_1 = 0
count_2 = 0
for i in range(N):
    if s_list[i] == "#":
        temp_start = i
        break
if temp_start == N+1:
    print(0)
    sys.exit()
for i in range(N)[::-1]:
    if s_list[i] == ".":
        temp_end = i
        break
if temp_end == N+1:
    temp_end = N-1
for i in range(temp_start,temp_end + 1):
    if s_list[i] == "#":
        count_1 += 1
    else :
        count_2 += 1
print(min(count_1,count_2))