import Data.List
import Control.Monad

main :: IO ()
main = do
    n <- readLn :: IO Int
    [a,b,c] <- map (sort . (map read . words)) . lines <$> getContents :: IO [[Int]]
    print . length $ [ 1
                     | i <- a
                     , j <- dropWhile (i >=) b
                     , k <- dropWhile (j >=) c
                     ]
