We study the dc Josephson effect in a diffusive multilayered SF'FF'S structure, where S is a superconductor and F,F' are different ferromagnets. We assume that the exchange energies in the F' and F layers are different (h and H, respectively) and the middle F layer consists of two layers with parallel or antiparallel magnetization vectors M . The M vectors in the left and right F' layers are generally not collinear to those in the F layer. In the limit of a weak proximity effect we use a linearized Usadel equation. Solving this equation, we calculate the Josephson critical current for arbitrary temperatures, arbitrary thicknesses of the F' and F layers (L h and LH ) in the case of parallel and antiparallel M orientations in the F layer. The part of the critical current IcSR formed by the short-range (SRC) singlet and S = 0 triplet condensate components decays on a short length ξH = D/H , whereas the part IcLR due to the long-range triplet |S| = 1 component (LRTC) decreases with increasing LH on the length ξN = D/πT . Our results are in a qualitative agreement with the experiment 36 .