import Data.List

--for IO
readInt :: String -> Int
readInt = read

--f1
tti0 :: Int -> Int -> [Int] -> Int
tti0 t a hl
  | xA > maximum hl    = (length hl)
  | xA < minimum hl    = 1
  | xA - fhi < shi- xA = (head $ elemIndices 0 $ map (subtract fhi) hl) + 1
  | otherwise          = (head $ elemIndices 0 $ map (subtract shi) hl) + 1
  where
    xA = (subtract a t)*1000 `div` 6
    fhi = last $ fst (partition (< xA) hl)
    shi = head $ snd (partition (< xA) hl)

main = do
  n <- getLine
  lstTA <- getLine
  lstHi <- getLine
  let ta = map readInt (words lstTA)
      t = head ta
      a = last ta
      hl = map readInt (words lstHi)
  print (tti0 t a hl)