N = int(input())
S = input()
s_list = list(S)
count_1 = 0
count_2 = 0
for i in range(N-1):
    if s_list[i] == "#" and s_list[i+1] == ".":
        temp_start = i
        break

for i in range(N)[::-1]:
    if s_list[i] != "#":
        temp_end = i
        break

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))