Each set is having m+2 parallel lines and each parallelogram is formed by choosing two straight lines from the first set and two straight lines from the second set. Two straight lines from the first set can be chosen in m+2C2 ways and two straight lines from the second set can be chosen in m+2C2 ways.
Hence the total of parallelograms formed =m+2C2⋅m+2C2=(m+2C2)2