'use strict'
function main(input) {
  let prev = []
  let next = []
  let mP = 0
  let mN = 0

  input = input.trim().split('\n')
  const NM = input[0].split(' ').map(v => v - 0)
  input[1].split(' ').forEach(v => {
    let n = v - 0
    if (n === 0) {
      NM[1]--
    } else {
      n < 0 ? prev.unshift(n*-1) : next.push(n)
    }
  })

  for (let i = 0; i < NM[1]; i++) {
    let p = prev.length ? prev[0] : -1
    let n = next.length ? next[0] : -1

    if (p === n && i < NM[1] - 1) {
      i++
      mP = prev.shift()
      mN = next.shift()
    } else {
      if (~p && ~n) p > n ? p = -1 : n = -1
      if (~p) {
        mP = prev.shift()
      } else {
        mN = next.shift()
      }
    }
  }

  console.log(mP > mN ? mP + mN * 2 : mN + mP * 2)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
