\[\boxed{\mathbf{810}.}\]
\[m = \log_{5}2;n = \log_{7}5:\]
\[\log_{350}140 = \frac{\log_{7}140}{\log_{7}350} =\]
\[= \frac{\log_{7}(7 \cdot 20)}{\log_{7}(7 \cdot 50)} =\]
\[= \frac{\log_{7}7 + \log_{7}20}{\log_{7}7 + \log_{7}50} =\]
\[= \frac{1 + \log_{7}20}{1 + \log_{7}50} =\]
\[= \frac{1 + \log_{7}(4 \cdot 5)}{1 + \log_{7}(10 \cdot 5)} =\]
\[= \frac{1 + \log_{7}4 + \log_{7}5}{1 + \log_{7}10 + \log_{7}5} =\]
\[= \frac{1 + \log_{7}2^{2} + \log_{7}5}{1 + \log_{7}(5 \cdot 2) + \log_{7}5} =\]
\[= \frac{1 + 2\log_{7}2 + \log_{7}5}{1 + \log_{7}5 + \log_{7}2 + \log_{7}5};\]
\[\log_{7}2 = \frac{\log_{5}2}{\log_{5}7};\ \ \ \ \]
\[\log_{7}5 = \frac{\log_{7}7}{\log_{7}5} = \frac{1}{\log_{7}5};\]
\[\frac{\log_{5}2}{\log_{5}7} = \frac{\log_{5}2}{\frac{1}{\log_{7}5}} = \log_{5}2 \cdot \log_{7}5;\]
\[\frac{1 + 2\log_{7}2 + \log_{7}5}{1 + \log_{7}5 + \log_{7}2 + \log_{7}5} =\]