def main(word):
    strs = list(word)
    reversed_strs = list(reversed(strs))
    # strs.reverse()
    # print(reversed_strs)

    last_del_num = 0
    for i, s in enumerate(reversed_strs):
        if s == ".":
            break
        if s == "#":
            last_del_num += 1

    del(reversed_strs[0:last_del_num])

    # print(reversed_strs)

    b_count = reversed_strs.count("#")
    w_count = reversed_strs.count(".")

    if b_count == 0:
        return 0

    if w_count == 0:
        return 0

    if b_count < w_count:
        return b_count

    return w_count


if __name__ == "__main__":
    input()
    word = input()
    print(main(word))

    # count = 0
    # iRegular = False
    # for i, _ in enumerate(strs):
    #     if i == 0:
    #         continue
    #     if strs[i-1] == "#" and strs[i] == ".":
    #         count += 1
    #         continue

    #     if i < 2:
    #         continue
    #     if iRegular and strs == ".":
    #         count += 1
    #         continue
    #     else:
    #         iRegular = False
    #     if strs[i-2] == "#" and strs[i-1] == "." and strs[i] == ".":
    #         iRegular = True
    #         count += 1
