import collections

N = int(input())
S = input()
S_list = []

for s in S:
    S_list.append(s)

C = collections.Counter(S_list)

w_count = 0
for s in S:
    if s == ".":
        w_count += 1
    else:
        break

print(min(C["#"], C["."] - w_count))
