Qualtrics Interview Question

Given a string which contains 8 coordinates that represent 2 rectangles, write code to find how many times the first rectangle can fit inside the overlapping areas of the rectangles without overlap.