By 2nd Newton's Law.
F =m*g
For 1st body
Let it's force be x
thus,
x = m*g --------- eqn 1
For mass 2,
F = 4m*g
g = F/4m -------- eqn 2
For the first body's force interms of second body substitute eqn 2 into 1
x = m*(F/4m)
x = m*F
4m
x = F/4
Therefore, the force on mass m interms of F is
F/4.