def main(word):
    strs = list(word)
    b_count = strs.count("#")
    w_count = strs.count(".")

    if b_count < w_count:
        if strs[len(strs)-1] == "#":
            return b_count-1
        else:
            return b_count

    else:
        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
