import Foundation
//typealias Array2D = [[Int]](repeating: [Int](repeating: 0, count: N), count: N)
let main: () = {
    let N = nextInt()
    let A = listOfInt()
    let MAX = 1000001
    var D = IntArray(MAX)
    for a in A {
        let w = D[a]
        D[a] += 1
        if w == 0 {
            for b in stride(from:a + a, to: MAX, by: a) {
                D[b] += 1
            }
        }
    }
    var ans = 0
    for a in A {
        if D[a] == 1 { ans += 1}
    }
    print(ans)
}()

struct SimpleModInt {
    let MOD = 998244353
    var value: Int {
        didSet {
            value %= MOD
        }
    }
    init(_ initialValue: Int) {
        value = initialValue
        value %= MOD
    }
    init(_ initialValue: SimpleModInt) {
        value = initialValue.value
        value %= MOD
    }
}
infix operator <-: AssignmentPrecedence
extension SimpleModInt {
    static func + (left: SimpleModInt, right: Int) -> SimpleModInt { SimpleModInt(left.value + right) }
    static func + (left: SimpleModInt, right: SimpleModInt) -> SimpleModInt { SimpleModInt(left.value + right.value) }
    static func - (left: SimpleModInt, right: Int) -> SimpleModInt { SimpleModInt(left.value - right) }
    static func - (left: SimpleModInt, right: SimpleModInt) -> SimpleModInt { SimpleModInt(left.value - right.value) }
    static func * (left: SimpleModInt, right: Int) -> SimpleModInt { SimpleModInt(left.value * right) }
    static func * (left: SimpleModInt, right: SimpleModInt) -> SimpleModInt { SimpleModInt(left.value * right.value) }
    static func <- (left: inout SimpleModInt, right: Int) { left.value = right }
    static func <- (left: inout SimpleModInt, right: SimpleModInt) { left.value = right.value }
    static func += (left: inout SimpleModInt, right: Int) { left.value += right }
    static func += (left: inout SimpleModInt, right: SimpleModInt) { left.value += right.value }
    static func -= (left: inout SimpleModInt, right: Int) { left.value -= right }
    static func -= (left: inout SimpleModInt, right: SimpleModInt) { left.value -= right.value }
    static func *= (left: inout SimpleModInt, right: Int) { left.value *= right }
    static func *= (left: inout SimpleModInt, right: SimpleModInt) { left.value *= right.value }
    static func == (left: SimpleModInt, right: Int) -> Bool { left.value == SimpleModInt(right).value }
    static func == (left: SimpleModInt, right: SimpleModInt) -> Bool { left.value == right.value }
    static func != (left: SimpleModInt, right: Int) -> Bool { left.value != SimpleModInt(right).value }
    static func != (left: SimpleModInt, right: SimpleModInt) -> Bool { left.value != right.value }
}

//----------------------------------

let dx = [1, 0, -1, 0] //[1, 0, -1, 0, -1,  1, -1, 1]
let dy = [0, 1, 0, -1] //[0, 1, 0, -1, -1, -1,  1, 1]

@inlinable func gcd(_ a: Int, _ b: Int) -> Int { (b > 0) ? gcd(b, a % b) : a }
@inlinable func lcm(_ a: Int, _ b: Int) -> Int { a / gcd(a, b) * b }

//----------------------------------

infix operator  =~ : ComparisonPrecedence
infix operator !=~ : ComparisonPrecedence
func =~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { !(right ~= left) }
func =~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { !(right ~= left) }

func =~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { right.contains(left) }
func !=~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { !right.contains(left) }

infix operator /^ : MultiplicationPrecedence
infix operator /^= : AssignmentPrecedence
func /^ <T: FixedWidthInteger>(left: T, right: T) -> T { (left + (right - 1)) / right }
func /^= <T: FixedWidthInteger>(left: inout T, right: T) { left = (left + (right - 1)) / right }

@inlinable func chmax<T: Comparable>(_ m: inout T, _ q: T) { if (m < q) { m = q } }
@inlinable func chmin<T: Comparable>(_ m: inout T, _ q: T) { if (m > q) { m = q } }
@inlinable func chRmax<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m < q) { m = q; return true } else { return false } }
@inlinable func chRmin<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m > q) { m = q; return true } else { return false } }

prefix operator *
prefix func * <T> (a: [T]) -> (T, T) { (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T) { (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T) { (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4], a[5]) }

func printErr(_ str: String, terminator: String = "\n") {
    let s = str + terminator
    FileHandle.standardError.write(s.data(using: .utf8)!)
    FileHandle.standardError.synchronizeFile()
}

@inlinable func next() -> String { readLine()! }
@inlinable func nextInt() -> Int { Int(next())! }
@inlinable func nextDouble() -> Double { Double(next())! }
@inlinable func listOfString() -> [String] { next().split(separator: " ").map(String.init) }
@inlinable func listOfInt() -> [Int] { listOfString().map { Int($0)! } }
@inlinable func listOfInt(_ offset: Int = 0) -> [Int] { listOfString().map { Int($0)! + offset } }
@inlinable func listOfInt(_ offsets: Int ...) -> [Int] { listOfString().enumerated().map { Int($0.element)! + offsets[$0.offset % offsets.count] } }
@inlinable func listOfDouble(_ offset: Double = 0.0) -> [Double] { listOfString().map { Double($0)! + offset } }
@inlinable func listOfDouble(_ offsets: Double ...) -> [Double] { listOfString().enumerated().map { Double($0.element)! + offsets[$0.offset % offsets.count] } }

extension Int {
    init(s: String) { self.init(s)! }
    var isEven: Bool { self.isMultiple(of: 2) }
    var isOdd: Bool { !self.isEven }
    var isTrue: Bool { self != 0 }
    var isFalse: Bool { !self.isTrue }
    var toString: String { String(self) }
    var toChar: Character { Character(UnicodeScalar(UInt8(self))) }
}
func + (left: Int, right: Bool) -> Int { left + (right ? 1 : 0) }
extension Character {
    var asciiCode: Int { Int(self.asciiValue!) }
    var string: String { String(self) }
}
extension String {
    @inlinable subscript (position: Int) -> Character { self[self.index(self.startIndex, offsetBy: position)] }
    @inlinable func repeate(_ times: Int) -> String { String(repeating: self, count: times) }
    //  @inlinable subscript (n: Int) -> String { String(self[self.index(self.startIndex, offsetBy: n)]) }
    //  @inlinable subscript (n: Int) -> Int { Int(self[self.index(self.startIndex, offsetBy: n)].asciiValue!) }
    var toInt: Int { Int(self)! }
}
extension String { // VB like
    @inlinable func _index(_ position: Int) -> String.Index! {
        if !(0 ..< self.count ~= position) { return nil }
        return self.index(self.startIndex, offsetBy: position)
    }
    @inlinable func mid(from index: Int, length: Int) -> String! {
        if let startPosition = self._index(index) {
            if let endPosition = self._index(index + length - 1) {
                return String(self[startPosition...endPosition])
            } else {
                let endPosition = self.index(before: self.endIndex)
                return String(self[startPosition...endPosition])
            }
        }
        return ""
    }
    @inlinable func left(_ length: Int) -> String { String(self.prefix(length)) }
    @inlinable func right(_ length: Int) -> String { String(self.suffix(length)) }
}

extension Dictionary {
    @inlinable mutating func getOrSet(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored }
        else {
            let newValue = defaultValue()
            self[key] = newValue
            return newValue
        }
    }
    @inlinable mutating func getOrElse(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored } else { return defaultValue() }
    }
    @inlinable func containsKey(_ key: Key) -> Bool { self.keys.contains(key) }
}

extension Set {
    static func += (left: inout Set<Element>, right: Element) { left.insert(right) }
    static func -= (left: inout Set<Element>, right: Element) { left.remove(right) }
}

extension Array {
    static func += (left: inout Array<Element>, right: Element) { left.append(right) }
    init(_ size: Int, _ initValue: ((Int) -> Element)) {
        self = [Element]()
        for index in 0 ..< size {
            let value = initValue(index)
            self.append(value)
        }
    }
    init(_ size: Int, _ initValue: (() -> Element)) {
        self = [Element]()
        for _ in 0 ..< size {
            let value = initValue()
            self.append(value)
        }
    }
}
typealias IntArray = Array<Int>
typealias DoubleArray = Array<Double>
typealias BoolArray = Array<Bool>
typealias StringArray = Array<String>

extension Array where Element == Int {
    init(_ size: Int) {
        self = [Element](repeating: 0, count: size)
    }
}
extension Array where Element == Double {
    init(_ size: Int) {
        self = [Element](repeating: 0.0, count: size)
    }
}
extension Array where Element == Bool {
    init(_ size: Int) {
        self = [Element](repeating: false, count: size)
    }
}
extension Array where Element == String {
    init(_ size: Int) {
        self = [Element](repeating: "", count: size)
    }
}

extension Array {
    @inlinable func count(_ predicate: ((Element) -> Bool)) -> Int {
        var cnt = 0; for e in self { if (predicate(e)) { cnt += 1 } }
        return cnt
    }
    @inlinable func groupBy<K>(_ keySelector: (Element) -> K) -> [K : [Element]] {
        var destination = [K : [Element]]()
        for element in self {
            let key = keySelector(element)
            var list = destination.getOrSet(key) { [Element]() }
            list.append(element)
            destination[key] = list
        }
        return destination
    }
    @inlinable func groupByIndexed<K>(_ keySelector: (Element) -> K) -> [K : [Int]] {
        var destination = [K : [Int]]()
        for element in self.enumerated() {
            let key = keySelector(element.element)
            var list = destination.getOrSet(key) { [Int]() }
            list.append(element.offset)
            destination[key] = list
        }
        return destination
    }
}

extension Array {
    func binarySearch(_ element: Element, by compare: (Element, Element) -> Int, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            let cmp = compare(midVal, element)
            if (cmp < 0) { low = mid + 1 }          //-1
            else if (0 < cmp) { high = mid - 1 }    // 1
            else { return mid } // key found        // 0
        }
        return -(low + 1)  // key not found
    }
}
extension Array where Element : Comparable {
    func binarySearch(_ element: Element, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            if (midVal < element) { low = mid + 1 }
            else if (midVal > element) { high = mid - 1 }
            else { return mid } // key found
        }
        return -(low + 1)  // key not found
    }
}

extension Array where Element == Int {
    @inlinable func distinct() -> [Element] {
        var set = Set<Element>(), ary = [Element]()
        for n in self.indices { if !set.contains(self[n]) { ary.append(self[n]); set.insert(self[n]) } }
        return ary
    }
    @inlinable func any(_ predicate: (Element) -> Bool) -> Bool {
        var any = false; for element in self { if predicate(element) { any = true } }
        return any
    }
    @inlinable func all(_ predicate: (Element) -> Bool) -> Bool {
        self.allSatisfy(predicate)
    }
    @inlinable func sum() -> Element { self.reduce(0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}

extension Array where Element == Double {
    @inlinable func sum() -> Element { self.reduce(0.0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0.0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}
extension Array where Element == String {
    @inlinable func toIntDouble() -> (Int, Double) { (Int(self[0])!, Double(self[1])!) }
    @inlinable func toIntString() -> (Int, String) { (Int(self[0])!, self[1]) }
    @inlinable func toIntIntString() -> (Int, Int, String) { (Int(self[0])!, Int(self[1])!, self[2]) }
}

@inlinable func block( _ action: () -> Void) {
    action()
}
@inlinable func repeate(_ times1: Int, _ action: () -> Void) {
    for _ in 0 ..< times1 { action() }
}
@inlinable func repeate(_ times1: Int, _ action: (Int) -> Void) {
    for index1 in 0 ..< times1 {
        action(index1)
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ action: (Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            action(index1, index2)
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ action: (Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                action(index1, index2, index3)
            }
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ times4: Int, _ action: (Int, Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                for index4 in 0 ..< times4 {
                    action(index1, index2, index3, index4)
                }
            }
        }
    }
}

func measureTimeSeconds(block: (() -> Void)) -> Double {
    let startTime = Date()
    block()
    let duration = -startTime.timeIntervalSinceNow
    return duration
}


class Scanner {
    private var stack = [String]()
    private var index = 0

    func peek() -> String {
        if stack.count == index {
            stack += readLine()!.split(separator: " ").map{ String($0) }
        }
        return stack[index]
    }

    func next() -> String {
        let value = peek()
        index += 1
        return value
    }

    func nextInt() -> Int {
        return Int(next())!
    }

    func nextDouble() -> Double {
        return Double(next())!
    }
}

var scanner = Scanner()

let N = scanner.nextInt()
let A = (0 ..< N).map { _ in scanner.nextInt() }

var count = [Int](repeating: 0, count: 1000001)

for x in A {
    count[x] += 1
}

var answer = 0
for i in 1 ... 1000000 {
    if count[i] == 1 {
        answer += 1
    }
    if count[i] > 0 {
        for j in stride(from: i, through: 1000000, by: i) {
            count[j] = 0
        }
    }
}

print(answer)


let N = Int(readLine()!)!
let A: [Int] = readLine()!.split(separator: " ").map { Int($0)! }.sorted()

var dp: [Bool] = Array(repeating: true, count: 3*Int(1e6))
var x: Int = -1
for a in A {
    if x == a { continue }
    x = a
    while x <= A[N-1] {
        x += a
        dp[x] = false
    }
    x = a
}

var res: Int = 0
for (i, a) in A.enumerated() {
    if i > 0 && a == A[i-1] { continue }
    if i < N-1 && a == A[i+1] { continue }
    if dp[a] { res += 1 }
}
print(res)  // (๑•ૅㅁ•๑)


import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

extension Int {

    // 約数
    var divisors: [Int] {
        var divisors: [Int] = []

        // √Nまで
        for number in 1...Int(sqrt(Double(self))) {
            if self % number == 0 {
                divisors.append(number)

                // N / aが割り切れる場合、N / aも約数
                if self.isMultiple(of: number), self / number != number {
                    divisors.append(self / number)
                }
            }
        }

//        divisors.sort(by: <)

        return divisors
    }
}

func mainD() {
    let N = readInt()
    let numbers = readInts()

    // 各数字があるかないかを表す配列
    var exists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)
    // 重複
    var doubleExists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)

    for number in numbers {
        if exists[number] {
            doubleExists[number] = true
            continue
        }

        exists[number] = true
    }

    var count = 0
    for number in numbers {
        if doubleExists[number] {
            continue
        }

        var answer = true

        // 約数で自分以外
        var divisors = number.divisors
        if divisors.count > 1 {
            divisors.remove(at: 1)
        }

        for divisor in divisors {
            if exists[divisor] {
                answer = false
                break
            }
        }

        if answer {
            count += 1
        }
    }

    print(count)
}
mainD()


import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

extension Int {

    // 約数
    var divisors: [Int] {
        var divisors: [Int] = []

        // √Nまで
        for number in 1...Int(sqrt(Double(self))) {
            if self % number == 0 {
                divisors.append(number)

                // N / aが割り切れる場合、N / aも約数
                if self.isMultiple(of: number), self / number != number {
                    divisors.append(self / number)
                }
            }
        }

//        divisors.sort(by: <)

        return divisors
    }
}

func mainD() {
    let N = readInt()
    let numbers = readInts()

    // 各数字があるかないかを表す配列
    var exists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)
    // 重複
    var doubleExists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)

    for number in numbers {
        if exists[number] {
            doubleExists[number] = true
            continue
        }

        exists[number] = true
    }

    var count = 0
    for number in numbers {
        if doubleExists[number] {
            continue
        }

        var answer = true

        // 約数で自分以外
        var divisors = number.divisors
        divisors.remove(at: 1)

        for divisor in divisors {
            if exists[divisor] {
                answer = false
                break
            }
        }

        if answer {
            count += 1
        }
    }

    print(count)
}
mainD()


import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

extension Int {

    // 約数
    var divisors: [Int] {
        var divisors: [Int] = []

        // √Nまで
        for number in 1...Int(sqrt(Double(self))) {
            if self % number == 0 {
                divisors.append(number)

                // N / aが割り切れる場合、N / aも約数
                if self.isMultiple(of: number), self / number != number {
                    divisors.append(self / number)
                }
            }
        }

//        divisors.sort(by: <)

        return divisors
    }
}

func mainD() {
    let N = readInt()
    let numbers = readInts()

    // 各数字があるかないかを表す配列
    var exists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)
    // 重複
    var doubleExists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)

    for number in numbers {
        if exists[number] {
            doubleExists[number] = true
            continue
        }

        exists[number] = true
    }

    var count = 0
    for number in numbers {
        if doubleExists[number] {
            continue
        }

        var answer = true

        // 約数で自分以外
        var divisors = number.divisors
        divisors.removeLast()

        for divisor in divisors {
            if exists[divisor] {
                answer = false
                break
            }
        }

        if answer {
            count += 1
        }
    }

    print(count)
}
mainD()


import * as fs from 'fs';

// main
function main(input: string[]) {
    // param
    var n: number = 0;
    var an: number[] = [];
    var ans: number = 0;
    // init
    n = Number(input.shift());
    an = input.shift().split(" ").map(x => Number(x));
    // solve
    an = an.sort((x, y) => x - y);
    var m = Math_max(an) + 1;
    var bm: number[] = new Array(m).fill(0);
    ans = 0;
    for (var nx = n - 1; 0 <= nx; nx--) {
        for (var mx = an[nx]; mx < m; mx += an[nx]) {
            bm[mx] += an[nx];
        }
    }
    for (var nx = 0; nx < n; nx++) {
        if (bm[an[nx]] == an[nx]) ans++;
    }
    // answer
    console.log(ans);
}

// graph lib
/*
function GRAPH_enumPattern(cur: number[], pat: number[][]): number[][] {
    var arr = [];
    for (var patx = 0; patx < pat.length; patx++) {
        var pos = [cur[0] + pat[patx][0], cur[1] + pat[patx][1]];
        arr.push(pos);
    }
    return arr;
}
*/

// math lib
function Math_max(arr: number[]): number { return arr.reduce((x, y) => Math.max(x, y)); }
/*
function Math_min(arr: number[]): number { return arr.reduce((x, y) => Math.min(x, y)); }
function Math_gcd(): number {
    var ans = arguments[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < arguments.length; i++) {
        ans = f(ans, arguments[i]);
    }
    return ans
};
function Math_gcdArray(values: number[]): number {
    var ans = values[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < values.length; i++) {
        ans = f(ans, values[i]);
    }
    return ans
};
function Math_lcm(): number {
    var a = arguments
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_lcmArray(values: number[]): number {
    var a = values
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_primeList(value: number): number[] {
    var ans = [];
    var arr = new Array(value).fill(0);
    for (var i = 2; i < value; i++) {
        if (arr[i] == 0) {
            for (var j = i; j < value; j += i) {
                if (arr[j] == 0) arr[j] = i;
            }
        }
    }
    for (var i = 2; i < value; i++) {
        if (arr[i] == i) ans.push(i);
    }
    return ans;
}
function Math_primeFactor(p: number[], value: number): number[][] {
    var ans: number[][] = [];
    var valmax = value / 2;;
    for (var i = 0; i < p.length; i++) {
        var prime = p[i];
        if (valmax < prime) break;
        var count = 0;
        while (value % prime == 0) {
            value /= prime;
            count++;
        }
        if (count != 0) {
            ans.push([prime, count]);
        }
        if (value == 1) break;
    }
    return ans;
}
*/

// union-find lib
/*
var g_uf_root: number[];
var g_uf_count: number[];
function UF_initRoot(num: number) {
    g_uf_root = new Array(num).fill(-1);
    g_uf_count = new Array(num).fill(1);
}
function UF_getRoot(index: number) {
    if (g_uf_root[index] < 0) {
        return index;
    } else {
        var work0: number = UF_getRoot(g_uf_root[index]);
        g_uf_root[index] = work0;
        return work0
    }
}
function UF_mergeRoot(a: number, b: number) {
    var root0: number = UF_getRoot(a);
    var root1: number = UF_getRoot(b);
    if (root0 == root1) return;
    if (root0 > root1) [root0, root1] = [root1, root0];
    g_uf_count[root0] += g_uf_count[root1];
    g_uf_count[root1] = 0;
    g_uf_root[root1] = root0;
}
*/

// entrypoint
function entrypoint() {
    try {
        // linux
        var input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            input = lines;
            main(input);
        });
    }
}
entrypoint();


import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const A = input[1].map(Number);
  const MAX = 10 ** 6;

  const divisorCounts: Array<number | undefined> = [];

  A.forEach((a) => {
    if (divisorCounts[a] !== undefined) {
      divisorCounts[a] = 2;

      return;
    }

    for (let i = a; i <= MAX; i += a) {
      divisorCounts[i] = (divisorCounts[i] || 0) + 1;
    }
  });

  let answer = 0;
  A.forEach((a) => {
    if (divisorCounts[a] === 1) {
      answer += 1;
    }
  });

  return answer;
};

console.log(main(read()));


// import std = require('tstl')

{
  type Print = void | string | number | string[] | number[]
  let outs: Print[] = []

  const main = (): Print => {
    const r = _io()
    const [N] = r.nn()
    let a = r.nn()

    a.sort((x, y) => x - y)
    const hash = {}
    const dups = {}

    a.forEach((v) => {
      if (hash[v]) dups[v] = true
      hash[v] = true
    })
    a = Object.keys(hash).map(Number)
    const hit = {}
    let pc = 0

    a.forEach((v) => {
      if (!hit[v] && !dups[v]) {
        pc++
      }
      if (hit[v]) {
        return
      }
      for (var i = v; i <= 1000000; i += v) {
        hit[i] = true
      }
    })
    // console.log(a)

    // for (var i = 3; i < 1000000; i += 2) {
    //   if (primes.every((p) => i % p !== 0)) {
    //     primes.push(i)
    //   }
    // }

    // const primes: number[] = []

    // for (let i = 0; i < a.length; i++) {
    //   if (primes.every((p) => a[i] % p !== 0)) {
    //     if (!dups[a[i]]) pc++
    //     primes.push(a[i])
    //   }
    // }
    return pc
  }

  const _io = (i = 0) => {
    const str = require('fs').readFileSync('/dev/stdin', 'utf8')
    const lines = str.trim().split('\n')
    const s = () => lines[i++] || ''
    const n = () => Number(s())

    const mn = (v: string[]) => v.map(Number)
    const sp = (v: string) => v.split(' ')

    const ss = () => sp(s())
    const nn = () => mn(ss())
    const nls = () => mn(lines.slice(i))
    const nnls = () => lines.slice(i).map((v) => mn(sp(v)))

    return { lines, s, n, ss, nn, nls, nnls }
  }

  outs.push(main())

  console.log(
    outs
      .map((line) => (typeof line === 'object' ? line.join(' ') : String(line)))
      .join('\n')
  )
}


import * as fs from 'fs';

// main
function main(input: string[]) {
    // param
    var n: number = 0;
    var an: number[] = [];
    var ans: number = 0;
    // init
    n = Number(input.shift());
    an = input.shift().split(" ").map(x => Number(x));
    // solve
    an = an.sort((x, y) => x - y);
    ans = 0;
    for (var nx = 0; nx < n; nx++) {
        for (var nxx = 0; nxx < n; nxx++) {
            if (nx == nxx) continue;
            else if (an[nx] < an[nxx]) {
                nxx = n;
                break;
            }
            else if (an[nx] % an[nxx] == 0) break;
        }
        if (nxx == n) {
            ans++;
        }
    }
    // answer
    console.log(ans);
}

// graph lib
/*
function GRAPH_enumPattern(cur: number[], pat: number[][]): number[][] {
    var arr = [];
    for (var patx = 0; patx < pat.length; patx++) {
        var pos = [cur[0] + pat[patx][0], cur[1] + pat[patx][1]];
        arr.push(pos);
    }
    return arr;
}
*/

// math lib
/*
function Math_max(arr: number[]): number { return arr.reduce((x, y) => Math.max(x, y)); }
function Math_min(arr: number[]): number { return arr.reduce((x, y) => Math.min(x, y)); }
function Math_gcd(): number {
    var ans = arguments[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < arguments.length; i++) {
        ans = f(ans, arguments[i]);
    }
    return ans
};
function Math_gcdArray(values: number[]): number {
    var ans = values[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < values.length; i++) {
        ans = f(ans, values[i]);
    }
    return ans
};
function Math_lcm(): number {
    var a = arguments
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_lcmArray(values: number[]): number {
    var a = values
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_primeList(value: number): number[] {
    var ans = [];
    var arr = new Array(value).fill(0);
    for (var i = 2; i < value; i++) {
        if (arr[i] == 0) {
            for (var j = i; j < value; j += i) {
                if (arr[j] == 0) arr[j] = i;
            }
        }
    }
    for (var i = 2; i < value; i++) {
        if (arr[i] == i) ans.push(i);
    }
    return ans;
}
function Math_primeFactor(p: number[], value: number): number[][] {
    var ans: number[][] = [];
    var valmax = value / 2;;
    for (var i = 0; i < p.length; i++) {
        var prime = p[i];
        if (valmax < prime) break;
        var count = 0;
        while (value % prime == 0) {
            value /= prime;
            count++;
        }
        if (count != 0) {
            ans.push([prime, count]);
        }
        if (value == 1) break;
    }
    return ans;
}
*/

// union-find lib
/*
var g_uf_root: number[];
var g_uf_count: number[];
function UF_initRoot(num: number) {
    g_uf_root = new Array(num).fill(-1);
    g_uf_count = new Array(num).fill(1);
}
function UF_getRoot(index: number) {
    if (g_uf_root[index] < 0) {
        return index;
    } else {
        var work0: number = UF_getRoot(g_uf_root[index]);
        g_uf_root[index] = work0;
        return work0
    }
}
function UF_mergeRoot(a: number, b: number) {
    var root0: number = UF_getRoot(a);
    var root1: number = UF_getRoot(b);
    if (root0 == root1) return;
    if (root0 > root1) [root0, root1] = [root1, root0];
    g_uf_count[root0] += g_uf_count[root1];
    g_uf_count[root1] = 0;
    g_uf_root[root1] = root0;
}
*/

// entrypoint
function entrypoint() {
    try {
        // linux
        var input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            input = lines;
            main(input);
        });
    }
}
entrypoint();


import * as fs from 'fs';

// main
function main(input: string[]) {
    // param
    var n: number = 0;
    var an: number[] = [];
    var ans: number = 0;
    // init
    n = Number(input.shift());
    an = input.shift().split(" ").map(x => Number(x));
    // solve
    an = an.sort((x, y) => x - y);
    console.error(an);
    ans = 0;
    for (var nx = 0; nx < n; nx++) {
        for (var nxx = 0; nxx < n; nxx++) {
            if (nx == nxx) continue;
            else if (an[nx] < an[nxx]) {
                nxx = n;
                break;
            }
            else if (an[nx] % an[nxx] == 0) break;
        }
        if (nxx == n) {
            console.error(an[nx]);
            ans++;
        }
    }
    // answer
    console.log(ans);
}

// graph lib
/*
function GRAPH_enumPattern(cur: number[], pat: number[][]): number[][] {
    var arr = [];
    for (var patx = 0; patx < pat.length; patx++) {
        var pos = [cur[0] + pat[patx][0], cur[1] + pat[patx][1]];
        arr.push(pos);
    }
    return arr;
}
*/

// math lib
/*
function Math_max(arr: number[]): number { return arr.reduce((x, y) => Math.max(x, y)); }
function Math_min(arr: number[]): number { return arr.reduce((x, y) => Math.min(x, y)); }
function Math_gcd(): number {
    var ans = arguments[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < arguments.length; i++) {
        ans = f(ans, arguments[i]);
    }
    return ans
};
function Math_gcdArray(values: number[]): number {
    var ans = values[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < values.length; i++) {
        ans = f(ans, values[i]);
    }
    return ans
};
function Math_lcm(): number {
    var a = arguments
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_lcmArray(values: number[]): number {
    var a = values
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_primeList(value: number): number[] {
    var ans = [];
    var arr = new Array(value).fill(0);
    for (var i = 2; i < value; i++) {
        if (arr[i] == 0) {
            for (var j = i; j < value; j += i) {
                if (arr[j] == 0) arr[j] = i;
            }
        }
    }
    for (var i = 2; i < value; i++) {
        if (arr[i] == i) ans.push(i);
    }
    return ans;
}
function Math_primeFactor(p: number[], value: number): number[][] {
    var ans: number[][] = [];
    var valmax = value / 2;;
    for (var i = 0; i < p.length; i++) {
        var prime = p[i];
        if (valmax < prime) break;
        var count = 0;
        while (value % prime == 0) {
            value /= prime;
            count++;
        }
        if (count != 0) {
            ans.push([prime, count]);
        }
        if (value == 1) break;
    }
    return ans;
}
*/

// union-find lib
/*
var g_uf_root: number[];
var g_uf_count: number[];
function UF_initRoot(num: number) {
    g_uf_root = new Array(num).fill(-1);
    g_uf_count = new Array(num).fill(1);
}
function UF_getRoot(index: number) {
    if (g_uf_root[index] < 0) {
        return index;
    } else {
        var work0: number = UF_getRoot(g_uf_root[index]);
        g_uf_root[index] = work0;
        return work0
    }
}
function UF_mergeRoot(a: number, b: number) {
    var root0: number = UF_getRoot(a);
    var root1: number = UF_getRoot(b);
    if (root0 == root1) return;
    if (root0 > root1) [root0, root1] = [root1, root0];
    g_uf_count[root0] += g_uf_count[root1];
    g_uf_count[root1] = 0;
    g_uf_root[root1] = root0;
}
*/

// entrypoint
function entrypoint() {
    try {
        // linux
        var input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            input = lines;
            main(input);
        });
    }
}
entrypoint();


// https://atcoder.jp/contests/abc170/submissions/14804545at
{
  const run = (input: string) => {
    let split = input.trim().split("\n")
    const n = parseInt(split[0])
    if (n == 1) return 0

    const numbers = split[1].split(" ").map(v => parseInt(v));

    const max = Math.max(...numbers);
    let list = {}
    for (let i = 1; i <= max; i++) {
      list[i] = 0
    }

    numbers.forEach(num => {
      let i = 1
      while (num * i <= max) {
        if (i === 1 && list[num * i] === 1) {
          list[num * i]++;
          break;
        }
        list[num * i]++;
        i++;
      }
    })

    let result = 0
    numbers.forEach(num => {
      if (list[num] == 1) {
        result++
      }
    })

    return result
  }

  const Main = (input: string) => {
    console.log(run(input))
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}


def A():
    n = int(input())
    print(-(-n//2))
A()


N=int(input())
print(N//2+N%2)


n= int(input())
ans=(n+1)//2
print(ans)


N = int(input())
pritn((N+1)//2)


N=int(input())
if(N%2==0):
  print(N/2)
else:
  print((N+1)/2)


N=int(input())
if(N%2==0):
  print(N/2)
else:
  print(N/2+1)


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String args[]) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int N = Integer.parseInt(br.readLine());
	if (N % 2 == 1)
	    System.out.println((N + 1) / 2);
	else
	    System.out.println(N / 2);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
    public static void main(String[] args) throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //コンソールから入れる際に高速に入れる方法

        String strArr = br.readLine();
        int a = Integer.parseInt(strArr);
        if (a % 2 == 1) {
        	int x = (a/2) + 1;
            System.out.println(x);
        } else {
        	System.out.println(a/2);
        }

    }
}


import java.io.*;
import java.util.*;

class Main{
    public static void main(String args[])throws IOException{
      try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

        int N = Integer.parseInt(br.readLine());

        if((N % 2) == 0){
          System.out.println(N/2);
        }else{
          System.out.println((N/2) + 1);
        }

      }
    }
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int N=sc.nextInt();

      	if(N%2=0){
         System.out.print(N/2);
      }else{
         System.out.print((N/2)+1);
      }
   }
}


import java.util.ArrayList;
import java.util.*;
import java.lang.*;
//import java.lang.*;
import java.util.regex.*;
public class Main{
     public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
     List<Integer> l=new ArrayList<>();
     List<Integer> search=new ArrayList<>();
     for(int i=0;i<3;i++){
         for(int j=0;j<3;j++)
            l.add(sc.nextInt());
     }
     Collections.sort(l);
   int n=sc.nextInt();
   for(int i=0;i<n;i++)
      search.add(sc.nextInt());

   Collections.sort(search);

   for(int i=0;i<search.size();i++){
         if(l.contains(search.get(i))){
            System.out.println("Yes");
            System.exit(0);
         }else continue;
   }
   System.out.println("NO");
   System.exit(0);
   }
}


import java.util.ArrayList;
import java.util.*;
import java.lang.*;
//import java.lang.*;
import java.util.regex.*;
public class CodeChef{
     public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
     List<Integer> l=new ArrayList<>();
     List<Integer> search=new ArrayList<>();
     for(int i=0;i<3;i++){
         for(int j=0;j<3;j++)
            l.add(sc.nextInt());
     }
     Collections.sort(l);
   int n=sc.nextInt();
   for(int i=0;i<n;i++)
      search.add(sc.nextInt());

   Collections.sort(search);

   for(int i=0;i<search.size();i++){
         if(l.contains(search.get(i))){
            System.out.println("Yes");
            System.exit(0);
         }else continue;
   }
   System.out.println("NO");
   System.exit(0);
   }
}


#include<cstdio>
using namespace std;
int a;
int main()
{
	scanf("%d",&a);
	printf("%d",(a+1)>>1);

 }


#include<stdio.h>
int main(){
int n;
  scanf("%d",&n);
  n++;
  printf("%d",n/2);
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>

using namespace std;

using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vpii=vector<pii>;

#define PI 3.1415926535897932384626433832795

int main(void)
{
	int n;
	while(scanf("%d", &n)==1)
	{
		int ans=(n+1)/2;
		printf("%d\n", ans);
	}
	return 0;
}


#include<stdio.h>
int main() {
  int N;
  scanf("%d", &N);
  if(N%2!=0){
  for(int i=1; i<=100; i++){
    if(N%2!=0){
       N=N-2;
       if(N<=1){
         N++;
       }else{}
    }else{
      printf("%d", i);
      break;
    }
  }
  }
  else if(N%2==0){
    printf("%d", N/2);
  }else{}
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
int N,a;
  cin >> N;

  a = (N+2-1)/2;
  cout << a <, endl;

}


#include <stdio.h>

int main(){

    int n;
    int a;
    scanf("%d", &n);

    for(int i = 0 ; i < n ; i++){
        scanf("%d", &a);
        if(i == 0){
            printf("1\n");
        }
        else if(a%2 == 0){
            printf("%d\n", a/2);
        }
        else if(a%2 != 0){
            printf("%d\n", a/2+1);
        }
    }

    return 0;
}


#include <stdio.h>

int main(){
  int n;
  scanf("%d",&n);
  printf("%d",(n+1)/2);
  return(0);
}


#include<stdio.h>

int main(){
  int n,a=0;
  scanf("%d",&n);
  if(n%2==0){
    a=n/2;
}
else{
  a=n/2;
  a+=1;
}
printf("%d",a);
return 0;
}


#include <stdio.h>

int main(void)
{
    int N, out;

    scanf("%d",&N);

    if(N % 2)
        out = N/2 + 1;

    else
    {
        out = N/2;
    }

printf("%d",out);

    return 0;
}


#include <stdio.h>

int main (){
int paper, page;
scanf("%d", &page);
do {
page-=2;
paper++;
}
while (page > 0);
printf("%d", paper);
return 0;
}

@Isaiah mustinya bener


S2: I - Sum of Digits
#include <stdio.h>

int main() {
  int T;
  char N[6];
  scanf("%d", &T);

  for(int i = 0; i < T; i++) {
    scanf("%s", N);

    int sum = 0;
    for(int j = 0; N[j] != '\0'; j++) {
      sum += N[j] - '0';
    }

    printf("%d\n", sum);
  }

  return 0;
}


#include<stdio.h>
int main(){

int main pages,paper;

scanf("%d",&pages);
paper=pages/2

If(pages%2!=0){
  printf("%d",paper+1);
}

else{
printf("%d",paper);
}

return 0;
}


// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
    var n = parseInt(input, 10);
    var kami = parseInt(n/2,10);
    var amari = n%2;

	//出力
	console.log('%d',kami+amari);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


// inputに入力データ全体が入る
function Main(input) {
 var a = Math.floor(input / 2);
 var b = input % 2;
 var ans = a + b;
  console.log(ans);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var N = myconv(next(),1);
    myout(Math.ceil(N / 2));
}


function main(input){
  var N = parseInt(input[0],10);

  if((N % 2) === 0){
    console.log(N / 2);
  }else{
    console.log((N + 1) / 2 );
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


2=a;
N/a


function displayDate(input){
	var pageCNT;

    input = input.split("\n")

  	const N = parseInt(input[0], 10);
	pageCNT = Math.ceil(N/2);
	console.log(pageCNT);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)

	n := nextInt()

	fmt.Println(n/2 + (n % 2))
}

// ---- readfunc
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var huge = int(math.Pow(10, 18))

const maxS = 50*50 + 5

func main() {
	var n int
	InputInt(" ", &n)
	Write(n/2 + n%2)
	Flush()
}

/*----------文字列関連----------*/

// ReverseByte byte列の反転
func ReverseByte(list []byte) []byte {
	l := len(list)
	res := make([]byte, l)
	for i := 0; i < l; i++ {
		res[i] = list[l-i-1]
	}
	return res
}

/*----------Intでの基本計算関数----------*/

// MinInt 最大値導出関数
func MinInt(nums ...int) int {
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		switch {
		case nums[i] < res:
			res = nums[i]
		}
	}
	return res
}

// MaxInt 最大値導出関数
func MaxInt(nums ...int) int {
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		switch {
		case nums[i] > res:
			res = nums[i]
		}
	}
	return res
}

// PowInt Int型での冪乗計算
func PowInt(n int, x int) int {
	res := 1
	for i := 0; i < x; i++ {
		res *= n
	}
	return res
}

// SumInt Int型での合計計算
func SumInt(A ...int) int {
	sum := 0
	for _, a := range A {
		sum += a
	}
	return sum
}

// AbsInt Int型での絶対値計算
func AbsInt(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

/*----------Int型スライスの基本計算関数----------*/

// MinIntVec 最大値導出関数 インデックスも返す
func MinIntVec(nums []int) (int, []int) {
	res := nums[0]
	var index []int
	for i := 0; i < len(nums); i++ {
		switch {
		case nums[i] < res:
			res = nums[i]
			index = []int{i}
		case nums[i] == res:
			index = append(index, i)
		}
	}
	return res, index
}

// MaxIntVec 最大値導出関数 インデックスも返す
func MaxIntVec(nums []int) (int, []int) {
	res := nums[0]
	var index []int
	for i := 0; i < len(nums); i++ {
		switch {
		case nums[i] > res:
			res = nums[i]
			index = []int{i}
		case nums[i] == res:
			index = append(index, i)
		}
	}
	return res, index
}

// SumIntVec Int型での合計計算
func SumIntVec(A []int) int {
	sum := 0
	for _, a := range A {
		sum += a
	}
	return sum
}

/*----------標準入力・出力用の関数----------*/
var reader = bufio.NewReader(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

// InputLine 次の標準入力をstring型として取得
func InputLine() string {
	buffer := make([]byte, 0)
	for true {
		line, isPrefix, _ := reader.ReadLine()
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// InputString いくつかの文字列をstring型で取得
func InputString(delim string, A ...*string) {
	L := strings.Split(InputLine(), delim)
	for i, a := range A {
		*a = L[i]
	}
}

// InputStringVec delim区切りの文字列をstring型のスライスとして取得
func InputStringVec(delim string,A *[]string) {
	L := strings.Split(InputLine(), delim)
  *A = make([]string,len(L))
  for i := range L {
		(*A)[i] = L[i]
	}
}

// InputInt いくつかの数値をint型で取得
func InputInt(delim string, A ...*int) {
	L := strings.Split(InputLine(), delim)
	for i, a := range A {
		*a, _ = strconv.Atoi(L[i])
	}
}

// InputIntVec delim区切りの数値をint型のスライスとして取得
func InputIntVec(delim string, A *[]int) {
	L := strings.Split(InputLine(), delim)
	*A = make([]int, len(L))
	for i := range L {
		(*A)[i], _ = strconv.Atoi(L[i])
	}
}

// Write バッファに対応した出力関数
func Write(s interface{}) {
	fmt.Fprintln(writer, s)
}

// WriteIntVec バッファに対応したInt型スライスの出力関数
func WriteIntVec(A []int) {
	S := make([]string, len(A))
	for i, a := range A {
		S[i] = strconv.Itoa(a)
	}
	Write(strings.Join(S, " "))
}

// Flush バッファした出力をフラッシュ
func Flush() {
	_ = writer.Flush()
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	const initialBufSize = 4096
	const maxBufSize = 1000000
	scanner.Buffer(make([]byte, initialBufSize), maxBufSize)
	scanner.Split(bufio.ScanWords)
	var N int64
	scanner.Scan()
	N, _ = strconv.ParseInt(scanner.Text(), 10, 64)
	fmt.Println(solve(N))
}
func solve(N int64) int64 {
	papers := N / 2
	if N%2 == 1 {
		papers++
	}
	return papers
}


package main

import "fmt"

func main() {
  var n int
  n = fmt.Scan(&n)
  fmt.Println((n + 1) / 2)
}


package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()

	N, err := strconv.Atoi(scanner.Text())
	if err != nil {
		log.Fatal(err)
	}

	if N/2 == 0 {
		fmt.Println(N / 2)
	} else {
		fmt.Println((N / 2) + 1)
	}
}


package main

import (
	"fmt"
)

func main () {
	var n int
	fmt.Scan(&n)
	fmt.Println(n/2+1)
}


N = gets.to_i
puts (N / 2.0).ceil


n = gets.chomp.to_i
if n%2 == 0 then
  puts n/2
else
  puts 1+(n/2)
end


N = gets.to_i

if N % 2 == 0
    puts "#{N / 2}"
else
    puts "#{(N / 2) + 1}"
end


n=gets.to_i
ans=(n/2).round
puts ans


n=gets.to_i
ans=(n/2+0.5).round
puts ans


n=gets.to_i
ans=(n/2+0.5).to_i
puts ans


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize
    }
    println!("{}", (n + 1) / 2);
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

pub trait LexicalPermutation {
    /// Return `true` if the slice was permuted, `false` if it is already
    /// at the last ordered permutation.
    fn next_permutation(&mut self) -> bool;
    /// Return `true` if the slice was permuted, `false` if it is already
    /// at the first ordered permutation.
    fn prev_permutation(&mut self) -> bool;
}

impl<T> LexicalPermutation for [T]
where
    T: Ord,
{
    /// Original author in Rust: Thomas Backman <serenity@exscape.org>
    fn next_permutation(&mut self) -> bool {
        // These cases only have 1 permutation each, so we can't do anything.
        if self.len() < 2 {
            return false;
        }

        // Step 1: Identify the longest, rightmost weakly decreasing part of the vector
        let mut i = self.len() - 1;
        while i > 0 && self[i - 1] >= self[i] {
            i -= 1;
        }

        // If that is the entire vector, this is the last-ordered permutation.
        if i == 0 {
            return false;
        }

        // Step 2: Find the rightmost element larger than the pivot (i-1)
        let mut j = self.len() - 1;
        while j >= i && self[j] <= self[i - 1] {
            j -= 1;
        }

        // Step 3: Swap that element with the pivot
        self.swap(j, i - 1);

        // Step 4: Reverse the (previously) weakly decreasing part
        self[i..].reverse();

        true
    }

    fn prev_permutation(&mut self) -> bool {
        // These cases only have 1 permutation each, so we can't do anything.
        if self.len() < 2 {
            return false;
        }

        // Step 1: Identify the longest, rightmost weakly increasing part of the vector
        let mut i = self.len() - 1;
        while i > 0 && self[i - 1] <= self[i] {
            i -= 1;
        }

        // If that is the entire vector, this is the first-ordered permutation.
        if i == 0 {
            return false;
        }

        // Step 2: Reverse the weakly increasing part
        self[i..].reverse();

        // Step 3: Find the rightmost element equal to or bigger than the pivot (i-1)
        let mut j = self.len() - 1;
        while j >= i && self[j - 1] < self[i - 1] {
            j -= 1;
        }

        // Step 4: Swap that element with the pivot
        self.swap(i - 1, j);

        true
    }
}

#[allow(dead_code)]
fn sieve_of_eratosthenes(n: usize) -> Vec<usize> {
    // spf:
    // store smallest prime factor of number
    // 最小の素因数を格納
    // is_prime:
    // 配列番号が素数であるかどうかを示す
    let mut spf = vec![None; n + 1];
    let mut is_prime = vec![true; n + 1];
    let mut primes = Vec::new();

    // 0 と 1 は素数ではない
    is_prime[0] = false;
    is_prime[1] = false;

    for i in 2..n + 1 {
        // is_prime[i]:
        // それ以下の素数で割り切られていなければ True となる
        if is_prime[i] {
            // この if 文より i は素数なので
            primes.push(i);

            // 素数はそれ自身の最も小さい素因数であるから
            spf[i] = Some(i);
        }

        // 全ての prime の倍数(prime * i)を取り除く
        for prime in &primes {
            // prime が i の最も小さい因数よりも大きくなってしまったら探索終了
            if i * prime >= n + 1 || prime > &spf[i].unwrap() {
                break;
            }

            is_prime[i * prime] = false;

            // i * primes[j] の最も小さい素数は primes[j] 自身
            spf[i * prime] = Some(*prime);
        }
    }
    primes
}
use std::cmp::Ordering;
#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Rev<T>(pub T);

impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}

impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}
#[allow(dead_code)]
fn gcd(a: u64, b: u64) -> u64 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}
#[allow(dead_code)]
fn lcm(a: u64, b: u64) -> u64 {
    a / gcd(a, b) * b
}

#[allow(dead_code)]
fn expected(p: u64) -> f64 {
    let p = p as f64;
    ((p * (p + 1.0)) / 2.0) / p
}

#[allow(unused_imports)]
use std::collections::BTreeSet;
#[allow(unused_imports)]
use std::collections::VecDeque;

#[allow(unused_mut)]
#[allow(unused_variables)]
#[allow(non_snake_case)]
fn main() {
    input! {N: u64};

    let ans = if 0 == N%2 {
        N/2
    }else{
        N/2 + 1
    };

    println!("{}",ans);

}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        n: usize,
    }

    if n%2==0{
        print!("{}", n/2);
    } else {
        println!("{}", n/2+1);
    }

}


use proconio::input;

fn main() {
    input! {
        n: f32,
    }

    println!("{}", (n / 2.0).ceil());
}


use std::io::stdin;
use std::io::Read;
use std::str::FromStr;

pub fn solve() -> i32 {
    let n: i32 = read();
    n - (n / 2)
}

fn read<T: FromStr>() -> T {
    let cin = stdin();
    let cin = cin.lock();
    let token: String = cin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
	println("{}", solve());
}


use std::io;

fn main() {
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf).unwrap();
    let n: u32 = buf.trim_end().parse().unwrap();
    println!("{}", (n - 1) / 2 + 1);
}


import Foundation

// 1
let N = Int(readLine()!)!
if N % 2 == 0 {
  print(N / 2)
} else {
  print((N / 2) + 1)
}


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let n = Int(readLine()!)!

    if n % 2 == 0 {
        print(n / 2)
    } else {
        print(n / 2 + 1)
    }
}

main()


// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let n = Int(readLine()!)!

    print(n % 2 == 0 ? n / 2: n / 2 + 1)
}

main()


import Foundation
let array = readLine()!.componentsSeparatedByString(" ").map{ Int($0)! }
var a = Double(array[0])
var b = (a+1)/2
print(b)


import Foundation
let array = readLine()!.componentsSeparatedByString(" ").map{ Int($0)! }
var a = Double(array[0])
var b = ceil(a/2)
print(b)


var n: Int = Int(readLine())
print((n+1)/2)


function main(input) {
  const inputs =input.split('\n')
  const [N] = inputs[0].split(' ').map(Number)

  console.log(Math.ceil(N / 2))
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


import * as fs from 'fs';

//in
//
//out
//
const main = (inp: string) => {

    if (parseInt(inp) % 2 ===0) {
        console.log(parseInt(inp) / 2);
    } else {
        console.log(Math.floor(parseInt(inp) / 2)+1);
    }
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim());


function Main(input) {
    const lines = input.split("\n");
    const n = lines[0];

    console.log(Math.ceil(n / 2));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


class AtCoder {
  // 入力系
  input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);
  input_i=-1;

  n(){
    this.input_i++;
    return Number(this.input[this.input_i]);
  }
  nn(n:number):number[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.n());
    }
    return a;
  }
  s(){
    this.input_i++;
    return String(this.input[this.input_i]);
  }
  ss(n:number):string[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.s());
    }
    return a;
  }

  // コンソール
  o(...a:any){
    console.log(...a);
  }

  // Math
  abs(a:number){
    return Math.abs(a);
  }
  min(...a:number[]){
    return Math.min(...a);
  }
  max(...a:number[]){
    return Math.max(...a);
  }
  floor(a:number){
    return Math.floor(a);
  }
  ceil(a:number){
    return Math.ceil(a);
  }
  round(a:number){
    return Math.round(a);
  }

  // ソート
  asc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return a-b});
  }
  desc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return b-a});
  }

  // 自作
  gcd(...arr:number[]):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=x;
    }
    return arr[arr.length-1];
  };
  lcm(...arr:number[]):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=arr[i]*arr[i+1]/x;
    }
    return arr[arr.length-1];
  };
  isPrime(n:number):boolean{
    if(n < 2) return false;
    const suq=Math.sqrt(n);
    for(let i=2;i<=suq;i++){
      if(n%i==0){
        return false;
      }
    }return true;
  };
  deduplicate(a:any[]):any[]{
    return Array.from(new Set(a));
  };
  f(roop:number, callback:any){
    for(let i=0;i<roop;i++){
      callback(i);
    }
  };
  Yes(){
    console.log('Yes');
  }
  No(){
    console.log('No');
  }
  YES(){
    console.log('YES');
  }
  NO(){
    console.log('NO');
  }
}
const m = () => {
  const o = new AtCoder();
  o.o(o.ceil(o.n()*2))
}
m();


W, a, b = map(int, raw_input().split())
if a <= b and b <= a + W:
    print 0
elif a <= b + W and b + W <= a + W:
    print 0
elif b > a + W:
    print abs(b - a - W)
else:
    print abs(a - b -W)


W,a,b = map(int,input().split())
if a > b:
    temp = b
    b = a
    a = temp
if a+W>=b:
    print(0)
else:
    print(b-(a+W))


W, a, b = map(int, input().split())
print(max(b-W-a, a-W-b, 0))


w,a,b = map(int,input().split())
#print(w,a,b)
if a+w == b:
  print(0)
elif a+w < b:
  print(b-(a+w))
elif a < b and b < a+w:
  print(0)
elif a == b:
  print(0)


w,a,b = map(int,input().split())
#print(w,a,b)
if a+w == b:
  print(0)
elif a+w < b:
  print(b-(a+w))
elif a+w >= b:
  print(0)
elif a == b:
  print(0)


w,a,b = map(int,input().split())
#print(w,a,b)
if a+w == b:
  print(w)
elif a+w < b:
  print(b-(a+w))
elif a+w >= b:
  print(0)
elif a == b:
  print(0)


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;

class Main {
    public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputString = Arrays.asList(br.readLine().split(" "));
            int W = Integer.parseInt(inputString.get(0));
            int a = Integer.parseInt(inputString.get(1));
            int b = Integer.parseInt(inputString.get(2));
            int aW = a + W;
            int bW = b + W;

            int ans = 0;
            if (aW< b) {
                ans = b - aW;
            } else if (aW>= b && aW <= bW) {
                ans = 0;
            } else if (bW <= aW && bW >= a) {
                ans = 0;
            } else {
                ans = a - bW;
            }

            System.out.println(ans);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}
public class Main {
	static FastScanner stdIn=new FastScanner();
	public static void main(String[] args) {
		int W=stdIn.nextInt();
		int a=stdIn.nextInt();
		int b=stdIn.nextInt();
		if(a<=b&&a+W>=b)
			System.out.println(0);
		else
			if(a<=b+W&&a+W>=b+W)
				System.out.println(0);
			else{
				System.out.println(Math.min(Math.abs(a-(b+W)),Math.abs(b-(a+W))));
			}
	}
}


import java.io.*;
import java.util.*;

public class Main {
  private static int solve(int w, int a, int b) {
    if (a + w < b) {
      return b - a - w;
    } else if (b + w < a) {
      return a - b - w;
    } else {
      return 0;
    }
  }

  private static void execute(ContestReader reader, PrintWriter out) {
    int w = reader.nextInt();
    int a = reader.nextInt();
    int b = reader.nextInt();
    out.println(solve(w, a, b));
  }

  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;

  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }

  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  public int nextInt() {
    return Integer.parseInt(next());
  }

  public long nextLong() {
    return Long.parseLong(next());
  }

  public double nextDouble() {
    return Double.parseDouble(next());
  }

  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }

  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }

  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }

  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }

  public char[] nextCharArray() {
    return next().toCharArray();
  }

  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }

  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }

  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }

  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		System.out.println(Math.abs(b - (a + w)) < 0 ? 0 : Math.max(a - (b + w), b - (a + w)));

		sc.close();

	}

}


import java.util.Scanner;

public class main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a + w <= b)System.out.println(b - (a + w));
        else if(b + w <= a) System.out.println(a - (b + w));
        else System.out.println(0);
    }
}


import java.util.*;

public class Main{
    public static void main (String[] args){
        Scanner sc = new Scanner(System.in);
        int W = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        if(a < b){
            System.out.println(b-(a+W));
        }else if(b < a){
            System.out.println(a-(b+W));
        }else if(a==b){
            System.out.println("0");
        }
    }
}


#include "stdio.h"

int main (void){
	int W, a, b;
	scanf("%d %d %d", &W, &a, &b);
	if(b > a + W){printf("%d\n",b - (a+W));}
	else if(a > b + W){printf("%d\n",a - (b+W));}
	else {printf("0\n");}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
using namespace std;

int m,a,b;

int main()
{
	scanf("%d%d%d",&m,&a,&b);
	if(a < b)
	{
		if(a + m >= b) printf("0\n");
		else printf("%d\n",b - a - m);
	}
	else if( a == b) printf("0\n");
    else{
        if(b + m >= a) printf("0\n");
		else printf("%d\n",a - b - m);
	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
    int n,k,i,t;
    while(scanf("%d %d %d",&n,&k,&i)==3)
    {
        if(k<i)
        {
            t=k;
            k=i;
            i=t;
        }
        if(k-i>n)
            printf("%d\n",k-i-n);
        else
            printf("0\n");
    }
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
  int W, a, b;
  cin >> W >> a >> b;

  cout << min(0, abs(a - b) - W) << endl;
  return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
  int W, a, b;
  cin >> W >> a >> b;

  cout << min(0, abs(W - abs(a - b))) << endl;
  return 0;
}


#include<bits/stdc++.h>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
#define pii pair<int,int>
#define all(x) begin(x), end(x)
#define loop(i,n) for(int i=0; i<n; i++)
#define rep(i,a,b,c) for(int i=a; i<b; i+=c)
#define brep(i,a,b,c) for(int i=a; i>b; i-=c)
#define tc(t) int t; cin>>t; while(t--)
#define sz(v) int((v).size())
#define pb push_back

using namespace std;

const int maxm = 1000000000 + 7;

double startTime;
double getCurrentTime() {
  return ((double)clock() - startTime) / CLOCKS_PER_SEC;
}

//----------->CODE BEGINS --------------->

int main()
{

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

   int w,a,b;
   cin>>w>>a>>b;

   int add1 = w+a;
   int add2 = w+b;

   ll ans = 0;

  if((w+a > b && a<b) || (w+b> a && a>b) ){
    ans = 0;
  }

   else
   {
     ans = min(abs(w+b-a),abs(w+a-b));
   }

   cout<<ans<<endl;

}


#include <stdio.h>
int max(int x, int y) {
	return x > y ? x : y;
}
int main() {
	int w, a, b;
	scanf("%d%d%d", &w, &a, &b);
	printf("%d\n", a + w <= b ? b - a - w : max(0, a - b - w));
	return 0;
}


#include<stdio.h>
#include<stdlib.h>

int main(){
int w,a,b;
scanf("%d%d%d",&w,&a,&b);
if(a+w<=b){
printf("%d",abs(b-(a+w)));
return 0;
}
if(b+w<a){
printf("%d",abs((b+w)-a));
return 0;
}
puts("0");
return 0;
}


#include<stdio.h>
int main ()
{

    int w,a,b,t;
    scanf("%d%d%d",&w,&a,&b);
    if(a>b)
    {
        t=a;
        a=b;
        b=t;
    }
    a=a+w;
    if(a>b)
        printf("0");
    else
        printf("%d",b-a);
    return 0;
}


#include <stdio.h>
int main(void){
    int w, a, b, move;
    scanf("%d%d%d", &w, &a, &b);
    if(a<b && (a+w)>=b) move=0;
    else if(a<b) move=b-(a+w);
    else if(a>b && (b+w)>=a) move=0;
    else if(a>b) move=a-(b+w);
    printf("%d", move);
    return 0;
}


#include <stdio.h>
int main(void){
  int W;
  int a,b;
  scanf("%d %d %d",&W,&a,&b);
  int c;
  c=b-(a+W);
  if(c<=0){
    printf("0\n");
  }
  else{
    printf("%d",c);
  }
  return 0;
}


#include<stdio.h>
int main()
{

    unsigned long long w,a,b;
    scanf("%llu%llu%llu",&w,&a,&b);
    if(a+w<=b)
        printf("%llu\n",b-(a+w));
    else if(b+w<=a)
        printf("%llu\n",a-(b+w));
    if(a+w>b||b+w>a)
        printf("0\n");

    return 0;
}


"use strict";

const main = arg => {
    arg = arg.split("\n");
    const W = parseInt(arg[0].split(" ")[0]);
    const a = parseInt(arg[0].split(" ")[1]);
    const b = parseInt(arg[0].split(" ")[2]);

    if(a <= b && b <= (a + W)) {
        console.log(0);
        return;
    }

    if(a <= (b + W) && (b + W) <= (a + W)) {
        console.log(0);
        return;
    }

    console.log(a < b ? b - (a + W) : a - (b + W));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function Main(input) {
  input = input.split(" ");
  var w = parseInt(input[0]);
  var a = parseInt(input[1]);
  var b = parseInt(input[2]);
  var s;
  if(a>b){
    var c = a;
    a=b;
    b=c;
  }
    if(a+w>=b){
      s=0;

    }else{
      s=b-(a+w);
    }

  console.log('%s', s);
}

// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(){
  var input = document.getElementById("input").value;
  Main(input);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


// ABC056 B - NarrowRectanglesEasy;
'use strict';

function Main(input) {
    const tmp = input.trim().split('\n')[0].split(' ');
    const W = Number(tmp[0]);
    const a = Number(tmp[1]);
    const b = Number(tmp[2]);
    // console.log(W, a, b);

    let result;
    result = Math.abs(a - b) - W;
    if (result < 0) {
        result = 0;
    }
    console.log(result);
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));

// Main(`3 2 6`); // 1
// Main(`3 1 3`); // 0
// Main(`5 10 1`); // 4


function Main(input) {
    input = input.split(" ").map(Number);
    console.log(Math.max(0,input[2]-input[1]-input[0]))
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


function Main(input) {
    input = input.split(" ").map(Number);
    console.log(Mayh.max(0,input[2]-input[1]-input[0]))
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


"use strict";

const main = arg => {
    arg = arg.split("\n");
    const W = parseInt(arg[0].split(" ")[0]);
    const a = parseInt(arg[0].split(" ")[1]);
    const b = parseInt(arg[0].split(" ")[2]);

    if((a + W) > b || (b + W) > a) {
        console.log(0);
        return;
    }

    console.log(a < b ? b - (a + W) : a - (b + W));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


package main

import "fmt"

func main() {
	var w, a, b int
	fmt.Scan(&w, &a, &b)
	if a+w < b {
		fmt.Print(b - (a + w))
	} else if b+w < a {
		fmt.Print(a - (b + w))
	} else {
		fmt.Print(0)
	}
}


package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	W := getInt()
	a := getInt()
	b := getInt()

	al := a
	ar := a + W
	bl := b
	br := b + W

	if (al <= bl && bl <= ar) || (al <= br && br <= ar) {
		fmt.Println(0)
	} else {
		fmt.Println(min(abs(al - br), abs(ar - bl)))
	}
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func bfs(c int, graph *Graph) {
	next := make([]int, 0)
	next = append(next, c)
	visited := make(map[int]struct{})

	for ; len(next) != 0; {
		u := next[0]
		next = next[1:]
		visited[u] = struct{}{}

		for _, v := range graph.edges[u] {
			_, flag := visited[v]
			if flag {
				continue
			}

			// なにか処理

			next = append(next, v)
		}
	}
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getIntArray(n int) []int {
	array := make([]int, n)
	for i := 0; i < n; i++ {
		array[i] = getInt()
	}
	return array
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func getStringArray(n int) []string {
	array := make([]string, n)
	for i := 0; i < n; i++ {
		array[i] = getString()
	}
	return array
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return calcMod(n * powMod(n, p-1))
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func isPrime(n int) bool {
	if n < 2 {
		return false
	} else if n == 2 {
		return true
	} else if n % 2 == 0 {
		return false
	}

	sqrtN := int(math.Sqrt(float64(n)))
	for i := 3; i <= sqrtN; i += 2 {
		if n % i == 0 {
			return false
		}
	}

	return true
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func makeRange(min, max int) []int {
	a := make([]int, max-min+1)
	for i := range a {
		a[i] = min + i
	}
	return a
}

func powerset2(nums []int) [][]int {
	length := int(math.Pow(2, float64(len(nums))))
	result := make([][]int, length)

	index := 0
	result[index] = []int{}
	index++

	for _, n := range nums {
		max := index
		for i := 0; i < max; i++ {
			result[index] = copyAndAppend(result[i], n)
			index++
		}
	}

	return result
}

func copyAndAppend(nums []int, n int) []int {
	dst := make([]int, len(nums)+1)
	copy(dst, nums)
	dst[len(nums)] = n
	return dst
}

func calcGcd(x, y int) int {
	if y == 0 {
		return x
	} else if x >= y {
		return calcGcd(y, x % y)
	} else {
		return calcGcd(x, y % x)
	}
}

func getDivisor(n int) []int {
	var divisor []int
	divisor = append(divisor, 1)
	if n != 1 {
		divisor = append(divisor, n)
	}

	sqrt := int(math.Sqrt(float64(n)))
	for i := 2; i <= sqrt; i++ {
		if n % i == 0 {
			divisor = append(divisor, i)
			divisor = append(divisor, n/i)
		}
	}
	return divisor
}

type intHeap []int

func (h intHeap) Len() int {
	return len(h)
}

func (h intHeap) Less(i, j int) bool {
	return h[i] > h[j]
}

func (h intHeap) Swap(i, j int) {
	h[i], h[j] = h[j], h[i]
}

func (h *intHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *intHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func initHeap() *intHeap {
	ih := &intHeap{}
	heap.Init(ih)
	return ih
}

func (h *intHeap) pushHeap(n int) {
	heap.Push(h, n)
}

func (h *intHeap) popHeap() int {
	return heap.Pop(h).(int)
}

func factMod(n int) int {
	value := 1
	for ; n > 1; n-- {
		value = calcMod(value * n)
	}
	return value
}

func combinationMod(n, k int) int {
	factN := factMod(n)
	factK := factMod(k)
	factNK := factMod(n - k)
	factKR := powMod(factK, mod - 2)
	factNKR := powMod(factNK, mod - 2)
	return calcMod(factN * calcMod(factKR * factNKR))
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	W, a, b := nextInt(), nextInt(), nextInt()
	if a > b {
		a, b = b, a
	}
	fmt.Println(MaxOf(0, b-(a+W)))
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func abs(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func pow(p, q int) int {
	res := p
	if q == 0 {
		return 1
	}
	for i := 0; i < q-1; i++ {
		res *= p
	}
	return res
}

func MinOf(vars ...int) int {
	min := vars[0]
	for _, i := range vars {
		if min > i {
			min = i
		}
	}
	return min
}

func MaxOf(vars ...int) int {
	max := vars[0]
	for _, i := range vars {
		if max < i {
			max = i
		}
	}
	return max
}

func gcdof2numbers(a int, b int) int {
	if b == 0 {
		return a
	}
	return gcdof2numbers(b, a%b)
}

func lcmof2numbers(a int, b int) int {
	return a / gcdof2numbers(a, b) * b
}

// マイナスの場合は考慮していない
func fuctorial(a int) int {
	if a == 1 || a == 0 {
		return 1
	} else {
		return fuctorial(a-1) * a
	}
}

func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}

// 素因数分解したmapを返す
func primeFuctorize(n int) map[int]int {
	pf := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			pf[i]++
			n /= i
		}
	}
	if n != 1 {
		pf[n]++
	}
	return pf
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var W, a, b int
	fmt.Scan(&W, &a, &b)
	if a > b {
		a, b = swap(a, b)
	}
	if b > a+W {
		fmt.Println(b - a - W)
	} else {
		fmt.Println(0)
	}
}
func swap(a, b int) (int, int) {
	if a > b {
		t := a
		a = b
		b = t
	}
	return a, b
}


package main

import "fmt"

func main() {
	var W, a, b int
	fmt.Scan(&W, &a, &b)
	ans := 10000000
	if a <= b && b <= a + W {
		ans = 0
	} else if a + W < b {
		ans = b - (a + W)
	} else {
		ans = a - (b - W)
	}
	fmt.Println(ans)
}


package main

import "fmt"

func main() {
	var W, a, b int;

	fmt.Scan(&W, &a, &b);

	if a + W >= b {
		fmt.Println(0)
	}else if a+W < b{
		fmt.Println(b - (a + W))
	}else {
		fmt.Println(a - (b + W))
	}
}


# https://atcoder.jp/contests/abc056/tasks/abc056_b

W, a, b = gets.split.map(&:to_i)

puts a < b ? [b - (a + W), 0].max : [a - (b + W), 0].max


w, a, b = gets.chomp.split.map(&:to_i)
puts [0, [b - (a + w), a - (b + w)].max].max


W, a, b = gets.chomp.split.map(&:to_i)

if (W + a) < b
  puts (b - (W + a)).abs
elsif (W + b) < a
  puts (a - (W + b)).abs
else
  puts "0"
end


w,a,b=gets.split.map(&:to_i)
p b-a-w<0?0: b-a-w


if b >= (a+w)
  puts b-(a+w)
elsif (b+w) < a
  puts a-(b+w)
else
  puts 0
end


w,a,b = gets.split.map(&:to_i)

if (a+w) < b
  puts b-(a+w)
elsif b-(a+w) < 0
 puts w-b
else
  puts 0
end


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::cmp::max;

fn main() {
    let w: i64 = read();
    let a: i64 = read();
    let b: i64 = read();
    if a < b {
        if a + w < b {
            println!("{}", b - (w + a));
        } else {
            println!("{}", 0);
        }
    } else {
        if b + w < a {
            println!("{}", a - (b + w));
        } else {
            println!("{}", 0);
        }
    }
}


use std::cmp::max;
use std::mem::swap;
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        w:i32,
        _a:i32,
        _b:i32
    }
    let mut a = _a;
    let mut b = _b;
    if a > b{
        swap(&mut a, &mut b);
    }
    let mut ans:i32 = b - (a+w);
    println!("{}",max(0, ans));
}


use std::io;
use std::cmp::min;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let w = v[0];
	let a = v[1];
	let b = v[2];
	if (b >= a && b <= a+w) || (b+w >= a && b+w <= a+w){
		println!("0");
	}else{
		println!("{}", min((b-(a+w)).abs(), (a-(b+w)).abs()));
	}
}


use std::io;
use std::io::{stdin, Read};
use std::process::exit;
use std::cmp::min;

fn main() {

    let mut scan = stdin();
    let mut line = String::new();

    let _ = scan.read_line(&mut line);
    let inputs: Vec<&str> = line.split_whitespace().collect();

    let w: i32 = inputs[0].parse().unwrap();
    let a: i32 = inputs[1].parse().unwrap();
    let b: i32 = inputs[2].parse().unwrap();

    println!("w:{} a:{} b:{}", w,a,b);

    // (a+w)-b

    let mut v = 0;

    if a+w < b {
        v = (a+w)-b;
    } else if b+w < a{
        v = a-(b+w);
    } else {
        v = 0;
    }

    println!("{}",v.abs());

}


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::cmp::max;

fn main() {
    let w: i64 = read();
    let a: i64 = read();
    let b: i64 = read();
    println!("{}", max(a - (b + w), b - (w + a)));
}


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .bytes()
    .map(|c| c.expect("failed to read char") as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect();
  token.parse().ok().expect("failed to parse token")
}

use std::cmp::{max, min};
use std::collections::HashMap;

fn main() {
  let w = read::<i64>();
  let a = read::<i64>();
  let b = read::<i64>();

  println!("{}", max(0, b - (w + a)));
}


let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (W,a,b) = (input[0],input[1],input[2])
print(max(abs(a-b)-W,0))


import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (W, a, b) = (input[0], input[1], input[2])
print(max(max(b-(a+W), 0), max(a-(b+W), 0)))


let i=readLine()!.characters.split(" ").map{Int(String($0))!};print(max(abs(i[1]-i[2])-i[0],0))


let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (W,a,b) = (input[0],input[1],input[2])
print(max(b-a-W,a-b-W))


import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (W, a, b) = (input[0], input[1], input[2])
print(min(max(b-(a+W), 0), max(a-(b+W), 0)))


import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (W, a, b) = (input[0], input[1], input[2])
var ans = b-(a+W)
if ans < 0 {
    ans = a-(b+W)
}
print(ans)


function main(input) {
  const [w, a, b] = input.trim().split(" ").map(n => Number(n));
  const min = Math.min(a, b);
  const max = Math.max(a, b);
  const result = min + w < max ? max - min - w : 0;
  console.log(result);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
   let W = xs[0];
   let a = xs[1];
   let b = xs[2];
   let ans = 0;
   if(b-a>=W){
      console.log(ans=(b-a)-W);
   }else if(a-b>=W){
      console.log(ans=(a-b)-W);
   }else{
      console.log(ans=0);
   }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));