import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  (m1 : _) <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  (m2 : _) <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  print $ if m1 /= m0 then 1 else 0

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n
