Kepler's Third law helps us here. It states, in the general form, that for two bodies orbiting each other
where `T` is the period, `a` is the (mean) distance, `m_1` and `m_2` are the masses and `G` is the gravitational constant.
We'll use this law twice, for the given system of two stars and for the system Earth+the Sun. For the latter we can neglect the mass of Earth. So we have
where `T_s` is the given stars' period, `a_s` is the distance between stars, `M` is their combined mass which we have to find, `T_E` is the Earth's period (1 year), `a_E=1.5*10^8 km` is the distance between Earth and the Sun, and `m_S` is the mass of the Sun.
Actually we are asked to find `M/m_S` which is equal to
`(T_E/T_s)^2*(a_s/a_E)^3 = ((1.5*10^8)/10^9)^2*10^3=22.5` (times, dimensionless).
So the answer is: the combined mass of the 2 stars is 22.5 solar masses.