let NK: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
let N: Int = NK[0]
let K: Int = NK[1]
var seqNow: [Int] = readLine()!.split(separator: " ").map { Int($0)! }

for _ in 0..<K {
    var seqNext = Array(repeating: 0, count: N+1)

    for (i, a) in seqNow.enumerated() {
        let left: Int = max(0, i-a)
        let right: Int = min(N, i+1+a)

        seqNext[left] += 1
        seqNext[right] += -1
    }
    for i in 1..<N {
        seqNext[i] = seqNext[i] + seqNext[i-1]
    }
    if seqNow[0..<N] == seqNext[0..<N] { break }
    seqNow[0..<N] = seqNext[0..<N]
}
var res: String = ""
for s in seqNow[0..<N-1]{
    res += "\(s) "
}
print(res + String(seqNow[N-1]))


import Foundation

private func readWords<T>(_ f: (Substring) -> T) -> [T] {
    return readLine()!.split(separator: " ").map(f)
}

prefix operator *
prefix func *<T>(a: inout IndexingIterator<[T]>) -> T {
    return a.next()!
}

func mainC() {
    var nk = readWords { Int($0)! }.makeIterator()
    let n = *nk
    let k = min(50, *nk)

    var A = readWords { Int($0)! }

    for _ in 1...k {
        var B = [Int](repeating: 0, count: n+1)
        for (i, a) in A.enumerated() {
            let l = max(0, i - a)
            let r = min(n, a + i + 1)
            B[l] += 1
            B[r] -= 1
        }

        var total = 0
        for i in 0..<n {
            A[i] = total + B[i]
            total = A[i]
        }
    }

    print(A.map{ $0.description }.joined(separator: " "))

}

mainC()


import Foundation

private func readWords<T>(_ f: (Substring) -> T) -> [T] {
    return readLine()!.split(separator: " ").lazy.map(f)
}

prefix operator *
prefix func *<T>(a: inout IndexingIterator<[T]>) -> T {
    return a.next()!
}

func mainC() {
    var nk = readWords { Int($0)! }.makeIterator()
    let n = *nk
    let k = min(50, *nk)

    var A = readWords { Int($0)! }

    for _ in 1...k {
        var B = [Int](repeating: 0, count: n+1)
        for (i, a) in A.enumerated() {
            let l = max(0, i - a)
            let r = min(n, a + i + 1)
            B[l] += 1
            B[r] -= 1
        }

        var total = 0
        for i in 0..<n {
            A[i] = total + B[i]
            total = A[i]
        }
    }

    print(A.lazy.map{ $0.description }.joined(separator: " "))

}

mainC()


let NK: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
let As: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
var seqNow: [Int] = Array(repeating: 0, count: NK[0]+1)
seqNow[0..<NK[0]] = As[0..<NK[0]]

for _ in 0..<NK[1] {
    var seqNext = Array(repeating: 0, count: NK[0]+1)
    var NCount = 0
    for (i, a) in seqNow.enumerated() {
        seqNext[max(0, i-a)] += 1
        seqNext[min(NK[0], i+1+a)] += -1
    }
    seqNow[0] = seqNext[0]
    for i in 1..<NK[0] {
        seqNow[i] = seqNow[i-1] + seqNext[i]
        if seqNow[i] == NK[0] { NCount += 1 }
    }
    if NCount == NK[0] { break }
}
var res: String = ""
for s in seqNow[0..<NK[0]-1]{
    res += "\(s) "
}
print(res + String(seqNow[NK[0]-1]))


let NK: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
let As: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
var seqNow: [Int] = Array(repeating: 0, count: NK[0]+1)
//var seqNext: [Int] = Array(repeating: 0, count: NK[0]+1)
seqNow[0..<NK[0]] = As[0..<NK[0]]

for _ in 1...NK[1] {
    var seqNext = Array(repeating: 0, count: NK[0]+1)
    for (i, a) in seqNow.enumerated() {
        seqNext[max(0, i-a)] += 1
        seqNext[min(NK[0], i+1+a)] += -1
    }
    seqNow[0] = seqNext[0]
    for i in 1..<NK[0] {
        seqNow[i] = seqNow[i-1] + seqNext[i]
    }
}
var res: String = ""
for s in seqNow[0..<NK[0]-1]{
    res += "\(s) "
}
print(res + String(seqNow[NK[0]-1]))


import Foundation

let line = readLine()!.components(separatedBy: " ").map { Int($0)! }
let N = line[0]
let K = line[1]
var A = readLine()!.components(separatedBy: " ").map { Int($0)! }

var zero = Array.init(repeating: 0, count: N)
var B = zero

for _ in 0..<K {
    for i in 0..<N {
        if A[i] == 0 {
            B[i] += 1
        } else {
            let s = 0 < i - A[i] ? i - A[i] : 0
            let e = i + A[i] < N ? i + A[i] : N - 1
            for t in s...e {
                B[t] += 1
            }
        }
    }
    A = B
    B = zero
}

let ans = A.map { String($0) }.joined(separator: " ")
print(ans)


import * as fs from "fs";

let [line1, line2] = fs.readFileSync("/dev/stdin", "utf8").trim().split('\n');

let [N, K] = line1.split(" ").map(Number);
let A = line2.split(" ").map(Number);

function makeOneStep(A: number[]): [boolean, number[]] {
    let B: number[] = new Array(N).fill(0);
    for(let i=0; i<N; i++) {
        let left = Math.max(0, i-A[i]), right = i+A[i];
        B[Math.max(0, left)] += 1;
        if (right+1 < N)
            B[right+1] -= 1;
    }
    let converged = true;
    for(let i=1; i<N; i++) {
        B[i] += B[i-1]
        converged = converged && B[i] == N;
    }
    return [converged, B];
}

let converged: boolean;

for(let i=0; i<K; i++) {
    [converged, A] = makeOneStep(A);
    if (converged)
        break;
}

console.log(A.map((a) => {return a.toString();}).join(" "));


// import std = require('tstl')

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

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

    for (let i = 0; i < K; i++) {
      let lightTable = {}
      const next: number[] = []
      let l = 0

      for (let j = 0; j < N; j++) {
        next[j] = l + 1
        if (!lightTable[j + A[j]]) lightTable[j + A[j]] = 0
        lightTable[j + A[j]]--

        l += 1
        l += lightTable[j] || 0
      }

      l = 0
      lightTable = {}
      for (let j = N - 1; j >= 0; j--) {
        next[j] += l
        if (!lightTable[j - A[j]]) lightTable[j - A[j]] = 0
        lightTable[j - A[j]]--

        l += 1
        l += lightTable[j] || 0
      }

      // console.log(next.join(' '))
      A = next
      if (A.every((v) => v === N)) {
        break
      }
    }

    return A
  }

  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 std = require('tstl')

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

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

    for (let i = 0; i < K; i++) {
      let lightTable = {}
      const next: number[] = []
      let l = 0

      for (let j = 0; j < N; j++) {
        next[j] = l + 1
        if (!lightTable[j + A[j]]) lightTable[j + A[j]] = 0
        lightTable[j + A[j]]--

        l += 1
        l += lightTable[j] || 0
      }

      l = 0
      lightTable = {}
      for (let j = N - 1; j >= 0; j--) {
        next[j] += l
        if (!lightTable[j - A[j]]) lightTable[j - A[j]] = 0
        lightTable[j - A[j]]--

        l += 1
        l += lightTable[j] || 0
      }

      // console.log(next.join(' '))
      A = next
      if (A.every((v) => v === K)) {
        break
      }
    }

    return A
  }

  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 std = require('tstl')

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

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

    const l = Math.min(K, 10 ** 5 / N)

    for (let i = 0; i < l; i++) {
      let lightTable = {}
      const next: number[] = []
      let l = 0

      for (let j = 0; j < N; j++) {
        next[j] = l + 1
        if (!lightTable[j + A[j]]) lightTable[j + A[j]] = 0
        lightTable[j + A[j]]--

        l += 1
        l += lightTable[j] || 0
      }

      l = 0
      lightTable = {}
      for (let j = N - 1; j >= 0; j--) {
        next[j] += l
        if (!lightTable[j - A[j]]) lightTable[j - A[j]] = 0
        lightTable[j - A[j]]--

        l += 1
        l += lightTable[j] || 0
      }

      // console.log(next.join(' '))
      A = next
    }

    return A
  }

  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')
  )
}


a,b,x=map(int,input().split());print(b//x-~-a//x)


a, b, x = map(int, input().split())
if a == 0:
    print(b // x + 1)
else:
    a -= 1
    print(b // x - a // x)


import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    a, b, x = map(int, input().split())
    ans = b//x - (a-1)//x
    print(ans)

if __name__ == '__main__':
    solve()


a = input().split(" ")
b = int(a[1])
x = int(a[2])
a = int(a[0])
print(int((b - a + 1) // x))


a,b,x = map(int,input().split())

p = (b-a+1)//x
N = a+p*x

while N <= b:
  if N%x == 0:
    p += 1
    break
  else:
    N += 1

print(p)


def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

def run():
    a, b, x = input_int_map()
    result = count_num(b, x) - count_num(a - 1, x)
    print(result)

def count_num(num, x):

    if num < 0:
        return 0

    return num // x

run()

# 2 4 3

# 3 4 3

# 2 6 3


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

public class Main {
    long a, b, x;

    public static void main(String args[]) {
        new Main().run();
    }

    void run() {
        FastReader sc = new FastReader();
        a = sc.nextLong();
        b = sc.nextLong();
        x = sc.nextLong();
        solve();
    }

    void solve() {
        long removedNum = (a % x == 0) ? a / x - 1 : a / x;
        System.out.println(b / x - removedNum);
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    static InputStream is;
    static PrintWriter out;
    static String INPUT = "";

    static void solve()
    {
        long a = nl();
        long b = nl();
        long x = nl();
        long count = b / x - a / x;
        if(a % x == 0) {
            count++;
        }

        out.println(count);
    }

    public static void main(String[] args) throws Exception
    {
        long S = System.currentTimeMillis();
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);

        solve();
        out.flush();
        long G = System.currentTimeMillis();
        tr(G-S+"ms");
    }

    private static boolean eof()
    {
        if(lenbuf == -1)return true;
        int lptr = ptrbuf;
        while(lptr < lenbuf)if(!isSpaceChar(inbuf[lptr++]))return false;

        try {
            is.mark(1000);
            while(true){
                int b = is.read();
                if(b == -1){
                    is.reset();
                    return true;
                }else if(!isSpaceChar(b)){
                    is.reset();
                    return false;
                }
            }
        } catch (IOException e) {
            return true;
        }
    }

    private static byte[] inbuf = new byte[1024];
    static int lenbuf = 0, ptrbuf = 0;

    private static int readByte()
    {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private static boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }

    private static int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private static double nd() { return Double.parseDouble(ns()); }
    private static char nc() { return (char)skip(); }

    private static String ns()
    {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private static char[] ns(int n)
    {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private static char[][] nm(int n, int m)
    {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private static int[] na(int n)
    {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private static int ni()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private static long nl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		long a = sc.nextLong();
		long b = sc.nextLong();
		long x = sc.nextLong();
		if (a == 0)
			System.out.println(b / x + 1);
		else
			System.out.println(b / x - (a - 1) / x);
	}

	//以下、自作ライブラリ

	/*
		int N = sc.nextInt();

		int[] a = new int[N];
		for (int i = 0; i < N; i++)
			a[i] = sc.nextInt();

		String s = sc.next();

		String[] a = new String[N];
		for (int i = 0; i < N; i++)
			a[i] = sc.next();
	 */

	//階乗
	public static int fact(int n) {
		if (n == 1 || n == 0)
			return 1;
		else
			return n * fact(n - 1);
	}

	//指定した値以上の要素が最初に現れる位置
	//要素の数は+1（配列のズレ)
	public static long lowerBound(int n, long[] x, long y) {
		int left = 0;
		int right = n;
		while (left < right) {
			int mid = (left + right) / 2;
			if (x[mid] < y) {
				left = mid + 1;
			} else {
				right = mid;
			}
		}
		return left;
	}

	//指定した値より大きい要素が最初に現れる位置
	//要素の数は+1（配列のズレ)
	public static long upperBound(int n, long[] x, long y) {
		int left = 0;
		int right = n;
		while (left < right) {
			int mid = (left + right) / 2;
			if (x[mid] <= y) {
				left = mid + 1;
			} else {
				right = mid;
			}
		}
		return left;
	}

	//最大公約数
	public static long gcd(long a, long b) {
		if (a < b)
			return gcd(b, a);
		long c = 0;
		c = a % b;
		if (c == 0)
			return b;
		return gcd(b, c);
	}

	//最小公倍数
	public static long lcm(long m, long n) {
		return m * n / gcd(m, n);
	}

	//素数判定
	public static boolean isPrime(int n) {
		if (n < 2)
			return false;
		if (n == 2)
			return true;
		if (n % 2 == 0)
			return false;

		for (int i = 3; i * i <= n; i += 2) {
			if (n % i == 0)
				return false;
		}
		return true;
	}
}

//以下、高速スキャナークラス
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());
	}
}


import java.util.Scanner;
public class Main {
	public static void main(String[]  args) {
		Scanner input = new Scanner(System.in);
		long a = input.nextLong();
        long b = input.nextLong();
        long x = input.nextLong();
        long count;
        if(b%x ==0 || a == x) {
        	count = Math.abs(b-a)/(x)+1;}
        else{
        	count = Math.abs(b-a)/(x);}
        System.out.println(count);
		   }
		}


import java.util.Scanner;
public class Main {
	public static void main(String[]  args) {
		Scanner input = new Scanner(System.in);
		long a = input.nextLong();
        long b = input.nextLong();
        long x = input.nextLong();
        long count;
        if(b%x !=0) {
           count = Math.abs(b-a)/(x);}
        else {
        count = Math.abs(b-a)/(x)+1;}
        System.out.println(count);
		   }
		}


import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		long x = sc.nextLong();
		long res=0;
		if (b-a ==0) {
			res =0;
		}
		else {
			res = (b/x) - (a/x);
			if (a%x==0) {
				res++;}
			}

		System.out.println(res);
	}

}


#include<iostream>
using namespace std;

int main() {
	long long a, b, x; cin >> a >> b >> x;

	long long ans = 0;
	if (a == 0); else ans -= (a-1) / x + 1;
	ans += b / x + 1;
	cout << ans << endl;

	return 0;
}


#include<bits/stdc++.h>
#include <iomanip>
#include <iostream>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
ll max(ll a, ll b){
    if(a > b) return a;
    else return b;
}

ll min(ll a, ll b){
    if(a < b) return a;
    else return b;
}

int main(void){
    ll a,b; cin >> a >> b;
    ll x; cin >> x;
    if(b % x != 0) b = (b/x) * x;
    if(a % x != 0) a = (a/x + 1) * x;
    cout << max(b/x - a/x + 1, 0) << endl;
}


#include <iostream>

using namespace std;

int main()
{
    long long a,b,x,cnt=0;
    cin>>a>>b>>x;
    if ( a % x ==0)
        cout<<b/x-a/x+1<<endl;
    else
        cout<<b/x-a/x<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define lln unsigned long long int
using namespace std;
int main()
{
    lln a,b,x;
    cin>>a>>b>>x;
    if(a>b)
        swap(a,b);
    if(a==b && a%x!=0)
    {
        cout<<0<<endl;
        return 0;
    }
    if(b==x)
    {
        cout<<1<<endl;
        return 0;
    }
    if(x>b)
    {
        cout<<0<<endl;
        return 0;
    }
    if(a==1 && x==1)
    {
        cout<<b<<endl;
        return 0;
    }
    if(x==1)
    {
        cout<<b-a+1<<endl;
        return 0;
    }
    lln ans=(b/x)-(a/x);
    if(a%x==0)
    {
        cout<<ans+1<<endl;
    }
    else
        cout<<ans<<endl;
}


/** author: __nishad__ **/
//#pragma GCC optimize(2)
//#pragma GCC optimize(3, "Ofast", "inline")
#include<bits/stdc++.h>
using namespace std;

typedef long long ll ;
typedef vector<ll> vll ;

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define precision(k) cout<<setprecision(k)<<fixed;
#define loop(i,a,b) for(ll i=(a);i<=(b);++i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define unq(v) sort(all(v)),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define pb push_back
#define mp make_pair
#define pi 3.14159265358979323
#define endl "\n"

int main()
{
    IOS;

    unsigned long long a, b, x, count=0, diff;
    cin>>a>>b>>x;

    diff = b - a;

    count = diff/x;

    if(diff != 0){
        if(a%x == 0)
            count++;

        cout<<count;
    }
    else
        cout<<"0";

}


#define LOCAL
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;
using ll = long long;
using P = pair<int, int>;

#define REP(i, x) for (int i = 0; i < (int) (x); i++)
#define REPS(i, x) for (int i = 1; i <= (int) (x); i++)
#define RREP(i, x) for (int i = ((int) (x) -1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int) (x)); i > 0; i--)
#define ALL(x) ((x).begin(), (x).end())
#define SIZE(x) ((int) (x).size())
#define BITS(x) (1LL << (x))

constexpr int INF = 1001001001;
constexpr ll LINF = 1001001001001001001LL;
constexpr int MOD = 1000000007;
constexpr double EPS = 1e-10;
constexpr double PI = 3.141592653589793;
constexpr int dx4[4] = {1, 0, -1, 0};
constexpr int dy4[4] = {0, 1, 0, -1};
constexpr int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
constexpr int dy8[8] = {1, 0, -1, 1, -1, 1, 0, -1};

random_device seed_gen;
mt19937 mrand(seed_gen());
mt19937_64 mrand64(seed_gen());
int rand32(int x) {
	return mrand() % x;
}
ll rand64(long x) {
	return mrand64() % x;
}

template<typename A, typename B> ostream& operator<<(ostream& out, const pair<A, B>& a) {
	out << "(" << a.first << "," << a.second << ")";
	return out;
}
template<typename T, size_t N> ostream& operator<<(ostream& out, const array<T, N>& a) {
	out << "[";
	bool first = true;
	for (auto& v : a) {
		out << (first ? "" : ",");
		out << v;
		first = 0;
	}
	out << "]";
	return out;
}
template<typename T> ostream& operator<<(ostream& out, const vector<T>& a) {
	out << "[";
	bool first = true;
	for (auto& v : a) {
		out << (first ? "" : ",");
		out << v;
		first = 0;
	}
	out << "]";
	return out;
}
template<typename T, class Cmp> ostream& operator<<(ostream& out, const set<T, Cmp>& a) {
	out << "{";
	bool first = true;
	for (auto& v : a) {
		out << (first ? "" : ",");
		out << v;
		first = 0;
	}
	out << "}";
	return out;
}
template<typename U, typename T, class Cmp> ostream& operator<<(ostream& out, const map<U, T, Cmp>& a) {
	out << "{";
	bool first = true;
	for (auto& p : a) {
		out << (first ? "" : ",");
		out << p.first << ": " << p.second;
		first = 0;
	}
	out << "}";
	return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template<typename Arg1> void __f(const char* name, Arg1&& arg1) {
	cerr << name << ": " << arg1 << endl;
}
template<typename Arg1, typename... Args> void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << ": " << arg1 << " |";
	__f(comma + 1, args...);
}

struct fast_ios {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	fast_ios() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH) cout << unitbuf;
	}
} fast_ios_;

int main() {
	long a, b, x;
	cin >> a >> b >> x;
	cout << b / x - (a - 1) / x << endl;
	return 0;
}


#include<stdio.h>
int main()
{
	long long int a,b,x;

	scanf("%lld%lld%lld",&a,&b,&x);

	if(a%x==0)
		printf("%lld",b/x-a/x+1);
	else
		printf("%lld",b/x-a/x);
	return 0;
}


#include <stdio.h>

int main()
{
    unsigned long int a, b, x, ans;

    scanf("%lu %lu %lu", &a, &b, &x);

    if ((a % x) == 0)
    {
	ans = (b / x) - (a / x) + 1;
    }
    else
    {
	ans = (b / x) - (a / x);
    }

    printf("%lu\n", ans);

    return 0;
}


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

int main() {

    long a, b, x;
    scanf("%ld %ld %ld", &a, &b, &x);

    long cnt01 = b / x;
    long cnt02;

    if (a == 0) {
        cnt02 = 0;
        cnt01++;
    } else {
        cnt02 = (a - 1) / x;

    }

    printf("%ld", cnt01 - cnt02);

    return 0;
}


#include <stdio.h>
#include <string.h>
#pragma warning(disable : 4996)

int main()
{

    long long a, b, x;
    long long count = 0;

    scanf("%lld %lld %lld", &a, &b, &x);

    long long ai = a / x;
    long long bi = b / x;

    long long start, goal;

    if (ai * x == a)
        start = ai;
    else
        start = ai + 1;

    goal = bi;

    printf("%d", goal - start+1);

    return 0;

}


#include <stdio.h>
#include <string.h>
#pragma warning(disable : 4996)

int main()
{

    long long a, b, x;
    long long count = 0;

    scanf("%lld %lld %lld", &a, &b, &x);

    long long ai = a / x;
    long long bi = b / x;

    long long start, goal;

    if (ai * x == a)
        start = ai;
    else
        start = ai + 1;

    goal = bi;

    printf("%d", goal - start);

    return 0;

}


#include <stdio.h>
#include <string.h>
#pragma warning(disable : 4996)

int main()
{

    long long a, b, x;
    long long count = 0;

    scanf("%lld %lld %lld", &a, &b, &x);

    if (a == 0)
        count = b / x + 1;
    else
        count = b / x - (a - 1) / x;

    printf("%d", count);

    return 0;

}


const D = 24;
const L = 3;

function new64(n) {
    return [n % (1<<D), (n / (1<<D)) | 0, 0];
}

function mul64s(a, b) {
    var r = [];
    var x = 0;
    for (var i = 0; i < L; i++) {
        x = a[i] * b + x;
        r[i] = x % (1<<D);
        x = Math.floor(x / (1<<D));
    }
    return r;
}

function add64s(a, b) {
    var r = [];
    var x = b;
    for (var i = 0; i < L; i++) {
        x = a[i] + x;
        r[i] = x % (1<<D);
        x = Math.floor(x / (1<<D));
    }
    return r;
}

function cmp64(a, b) {
    for (var i = L-1; i >= 0; i--) {
        if (a[i] < b[i]) return -1;
        if (a[i] > b[i]) return 1;
    }
    return 0;
}

function add64(a, b) {
    var r = [];
    var x = 0;
    for (var i = 0; i < L; i++) {
        x = a[i] + b[i] + x;
        r[i] = x % (1<<D);
        x = Math.floor(x / (1<<D));
    }
    return r;
}

function sub64(a, b) {
    var r = [];
    var x = 0;
    for (var i = 0; i < L; i++) {
        x = a[i] - b[i] - x;
        var borrow = 0;
        while (x < 0) {
            x += (1<<D);
            borrow++;
        }
        r[i] = x % (1<<D);
        x = borrow;
    }
    return r;
}

function div64s(a, b) {
    var x = 0;
    for (var i = L-1; i >= 0; i--) {
        x = a[i] + x * (1<<D);
        a[i] = (x / b) | 0;
        x = x % b;
    }
    return x;
}

function copy64(a, b) {
    for (var i = 0; i < L; i++) {
        a[i] = b[i];
    }
}

function shiftL64(a) {
    const msb = [0, 0, (1<<(D-1))];
    var d = a;
    var r = 0;
    if (cmp64(a, msb) >= 0) {
        r = 1;
        d = sub64(a, msb);
    }
    var c = add64(d, d);
    copy64(a, c);
    return r;
}

function div64(a, b) {
    var d = new64(0);
    var x = a.slice();
    var r = new64(0);
    for (var i = 0; i < L*D; i++) {
        var bit = shiftL64(x);
        shiftL64(d);
        d = add64s(d, bit);
        var y = 0;
        if (cmp64(d, b) >= 0) {
            d = sub64(d, b);
            y = 1;
        }
        shiftL64(r);
        r = add64s(r, y);
    }
    return r;
}

function parse64(s) {
    const l = s.length;
    var a = new64(0);
    for (var i = 0; i < l; i++) {
        a = mul64s(a, 10);
        a = add64s(a, parseInt(s.substr(i, 1), 10));
    }
    return a;
}

function print64(a) {
    var s = "";
    var x = a.slice();
    while (cmp64(x, new64(0)) !== 0) {
        s += div64s(x, 10);
    }
    if (s === "") {
        s = "0";
    }
    console.log(s.split('').reverse().join(''));
}

function divisors(a, x) {
    return add64s(div64(a, x), 1);
}

function solve(a, b, x) {
    return sub64(divisors(b, x), (cmp64(a, new64(1)) >= 0 ? divisors(sub64(a, new64(1)), x) : new64(0)));
}

function main(input) {
    const args = input.trim().split(' ');
    const a = parse64(args[0]);
    const b = parse64(args[1]);
    const x = parse64(args[2]);
    const c = solve(a, b, x);
    print64(c);
}

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


module.exports=function(e){var r={};function n(t){if(r[t])return r[t].exports;var i=r[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)n.d(t,i,function(r){return e[r]}.bind(null,i));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=0)}([function(e,r,n){"use strict";var t=n(1);n(2)(t.readFileSync("/dev/stdin","utf8"))},function(e,r){e.exports=require("fs")},function(e,r,n){"use strict";var t=n(3),i=n(5);e.exports=function(e){var r=new t(e);i(r)}},function(e,r,n){"use strict";var t=n(4);e.exports=class{constructor(e){var r=e.trim().split(/\s+/g);this.inp=new t(r)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(e,r,n){"use strict";e.exports=class{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=e.length,this.items=e,this.ind=0}enq(e){this.size+=1,this.items.push(e)}deq(){var e=this.items[this.ind];return this.size-=1,this.ind+=1,e}clear(){this.items=[],this.size=0,this.ind=0}}},function(e,r,n){"use strict";var t=n(6);function i(e,r){return e.eq(-1)?new t(0):e.idiv(r).plus(1)}e.exports=function(e){var r=e.inr(),n=e.inr(),o=e.inr(),s=new t(r),u=new t(n),f=new t(o),c=i(u,f).minus(i(s.minus(1),f));console.log(c.toString())}},function(e,r,n){var t;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,u=Math.ceil,f=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",a=1e14,h=14,p=9007199254740991,g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,w=1e9;function m(e){var r=0|e;return e>0||e===r?r:r-1}function v(e){for(var r,n,t=1,i=e.length,o=e[0]+"";t<i;){for(r=e[t++]+"",n=h-r.length;n--;r="0"+r);o+=r}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function b(e,r){var n,t,i=e.c,o=r.c,s=e.s,u=r.s,f=e.e,c=r.e;if(!s||!u)return null;if(n=i&&!i[0],t=o&&!o[0],n||t)return n?t?0:-u:s;if(s!=u)return s;if(n=s<0,t=f==c,!i||!o)return t?0:!i^n?1:-1;if(!t)return f>c^n?1:-1;for(u=(f=i.length)<(c=o.length)?f:c,s=0;s<u;s++)if(i[s]!=o[s])return i[s]>o[s]^n?1:-1;return f==c?0:f>c^n?1:-1}function y(e,r,n,t){if(e<r||e>n||e!==f(e))throw Error(c+(t||"Argument")+("number"==typeof e?e<r||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function O(e){var r=e.c.length-1;return m(e.e/h)==r&&e.c[r]%2!=0}function N(e,r){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(r<0?"e":"e+")+r}function E(e,r,n){var t,i;if(r<0){for(i=n+".";++r;i+=n);e=i+e}else if(++r>(t=e.length)){for(i=n,r-=t;--r;i+=n);e+=i}else r<t&&(e=e.slice(0,r)+"."+e.slice(r));return e}(o=function e(r){var n,t,i,o,A,x,S,_,P,R=k.prototype={constructor:k,toString:null,valueOf:null},D=new k(1),B=20,L=4,I=-7,M=21,T=-1e7,U=1e7,C=!1,j=1,q=0,G={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz";function k(e,r){var n,o,u,c,a,g,d,w,m=this;if(!(m instanceof k))return new k(e,r);if(null==r){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>U?m.c=m.e=null:e.e<T?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((g="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,a=e;a>=10;a/=10,c++);return void(c>U?m.c=m.e=null:(m.e=c,m.c=[e]))}w=String(e)}else{if(!s.test(w=String(e)))return i(m,w,g);m.s=45==w.charCodeAt(0)?(w=w.slice(1),-1):1}(c=w.indexOf("."))>-1&&(w=w.replace(".","")),(a=w.search(/e/i))>0?(c<0&&(c=a),c+=+w.slice(a+1),w=w.substring(0,a)):c<0&&(c=w.length)}else{if(y(r,2,F.length,"Base"),10==r)return V(m=new k(e),B+m.e+1,L);if(w=String(e),g="number"==typeof e){if(0*e!=0)return i(m,w,g,r);if(m.s=1/e<0?(w=w.slice(1),-1):1,k.DEBUG&&w.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else m.s=45===w.charCodeAt(0)?(w=w.slice(1),-1):1;for(n=F.slice(0,r),c=a=0,d=w.length;a<d;a++)if(n.indexOf(o=w.charAt(a))<0){if("."==o){if(a>c){c=d;continue}}else if(!u&&(w==w.toUpperCase()&&(w=w.toLowerCase())||w==w.toLowerCase()&&(w=w.toUpperCase()))){u=!0,a=-1,c=0;continue}return i(m,String(e),g,r)}g=!1,(c=(w=t(w,r,10,m.s)).indexOf("."))>-1?w=w.replace(".",""):c=w.length}for(a=0;48===w.charCodeAt(a);a++);for(d=w.length;48===w.charCodeAt(--d););if(w=w.slice(a,++d)){if(d-=a,g&&k.DEBUG&&d>15&&(e>p||e!==f(e)))throw Error(l+m.s*e);if((c=c-a-1)>U)m.c=m.e=null;else if(c<T)m.c=[m.e=0];else{if(m.e=c,m.c=[],a=(c+1)%h,c<0&&(a+=h),a<d){for(a&&m.c.push(+w.slice(0,a)),d-=h;a<d;)m.c.push(+w.slice(a,a+=h));a=h-(w=w.slice(a)).length}else a-=d;for(;a--;w+="0");m.c.push(+w)}}else m.c=[m.e=0]}function z(e,r,n,t){var i,o,s,u,f;if(null==n?n=L:y(n,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==r)f=v(e.c),f=1==t||2==t&&(s<=I||s>=M)?N(f,s):E(f,s,"0");else if(o=(e=V(new k(e),r,n)).e,u=(f=v(e.c)).length,1==t||2==t&&(r<=o||o<=I)){for(;u<r;f+="0",u++);f=N(f,o)}else if(r-=s,f=E(f,o,"0"),o+1>u){if(--r>0)for(f+=".";r--;f+="0");}else if((r+=o-u)>0)for(o+1==u&&(f+=".");r--;f+="0");return e.s<0&&i?"-"+f:f}function $(e,r){for(var n,t=1,i=new k(e[0]);t<e.length;t++){if(!(n=new k(e[t])).s){i=n;break}r.call(i,n)&&(i=n)}return i}function H(e,r,n){for(var t=1,i=r.length;!r[--i];r.pop());for(i=r[0];i>=10;i/=10,t++);return(n=t+n*h-1)>U?e.c=e.e=null:n<T?e.c=[e.e=0]:(e.e=n,e.c=r),e}function V(e,r,n,t){var i,o,s,c,l,p,d,w=e.c,m=g;if(w){e:{for(i=1,c=w[0];c>=10;c/=10,i++);if((o=r-i)<0)o+=h,s=r,d=(l=w[p=0])/m[i-s-1]%10|0;else if((p=u((o+1)/h))>=w.length){if(!t)break e;for(;w.length<=p;w.push(0));l=d=0,i=1,s=(o%=h)-h+1}else{for(l=c=w[p],i=1;c>=10;c/=10,i++);d=(s=(o%=h)-h+i)<0?0:l/m[i-s-1]%10|0}if(t=t||r<0||null!=w[p+1]||(s<0?l:l%m[i-s-1]),t=n<4?(d||t)&&(0==n||n==(e.s<0?3:2)):d>5||5==d&&(4==n||t||6==n&&(o>0?s>0?l/m[i-s]:0:w[p-1])%10&1||n==(e.s<0?8:7)),r<1||!w[0])return w.length=0,t?(r-=e.e+1,w[0]=m[(h-r%h)%h],e.e=-r||0):w[0]=e.e=0,e;if(0==o?(w.length=p,c=1,p--):(w.length=p+1,c=m[h-o],w[p]=s>0?f(l/m[i-s]%m[s])*c:0),t)for(;;){if(0==p){for(o=1,s=w[0];s>=10;s/=10,o++);for(s=w[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(e.e++,w[0]==a&&(w[0]=1));break}if(w[p]+=c,w[p]!=a)break;w[p--]=0,c=1}for(o=w.length;0===w[--o];w.pop());}e.e>U?e.c=e.e=null:e.e<T&&(e.c=[e.e=0])}return e}function W(e){var r,n=e.e;return null===n?e.toString():(r=v(e.c),r=n<=I||n>=M?N(r,n):E(r,n,"0"),e.s<0?"-"+r:r)}return k.clone=e,k.ROUND_UP=0,k.ROUND_DOWN=1,k.ROUND_CEIL=2,k.ROUND_FLOOR=3,k.ROUND_HALF_UP=4,k.ROUND_HALF_DOWN=5,k.ROUND_HALF_EVEN=6,k.ROUND_HALF_CEIL=7,k.ROUND_HALF_FLOOR=8,k.EUCLID=9,k.config=k.set=function(e){var r,n;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(y(n=e[r],0,w,r),B=n),e.hasOwnProperty(r="ROUNDING_MODE")&&(y(n=e[r],0,8,r),L=n),e.hasOwnProperty(r="EXPONENTIAL_AT")&&((n=e[r])&&n.pop?(y(n[0],-w,0,r),y(n[1],0,w,r),I=n[0],M=n[1]):(y(n,-w,w,r),I=-(M=n<0?-n:n))),e.hasOwnProperty(r="RANGE"))if((n=e[r])&&n.pop)y(n[0],-w,-1,r),y(n[1],1,w,r),T=n[0],U=n[1];else{if(y(n,-w,w,r),!n)throw Error(c+r+" cannot be zero: "+n);T=-(U=n<0?-n:n)}if(e.hasOwnProperty(r="CRYPTO")){if((n=e[r])!==!!n)throw Error(c+r+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw C=!n,Error(c+"crypto unavailable");C=n}else C=n}if(e.hasOwnProperty(r="MODULO_MODE")&&(y(n=e[r],0,9,r),j=n),e.hasOwnProperty(r="POW_PRECISION")&&(y(n=e[r],0,w,r),q=n),e.hasOwnProperty(r="FORMAT")){if("object"!=typeof(n=e[r]))throw Error(c+r+" not an object: "+n);G=n}if(e.hasOwnProperty(r="ALPHABET")){if("string"!=typeof(n=e[r])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(c+r+" invalid: "+n);F=n}}return{DECIMAL_PLACES:B,ROUNDING_MODE:L,EXPONENTIAL_AT:[I,M],RANGE:[T,U],CRYPTO:C,MODULO_MODE:j,POW_PRECISION:q,FORMAT:G,ALPHABET:F}},k.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!k.DEBUG)return!0;var r,n,t=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(t)){if((1===o||-1===o)&&i>=-w&&i<=w&&i===f(i)){if(0===t[0]){if(0===i&&1===t.length)return!0;break e}if((r=(i+1)%h)<1&&(r+=h),String(t[0]).length==r){for(r=0;r<t.length;r++)if((n=t[r])<0||n>=a||n!==f(n))break e;if(0!==n)return!0}}}else if(null===t&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},k.maximum=k.max=function(){return $(arguments,R.lt)},k.minimum=k.min=function(){return $(arguments,R.gt)},k.random=(o=9007199254740992*Math.random()&2097151?function(){return f(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var r,n,t,i,s,l=0,a=[],p=new k(D);if(null==e?e=B:y(e,0,w),i=u(e/h),C)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(i*=2));l<i;)(s=131072*r[l]+(r[l+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),r[l]=n[0],r[l+1]=n[1]):(a.push(s%1e14),l+=2);l=i/2}else{if(!crypto.randomBytes)throw C=!1,Error(c+"crypto unavailable");for(r=crypto.randomBytes(i*=7);l<i;)(s=281474976710656*(31&r[l])+1099511627776*r[l+1]+4294967296*r[l+2]+16777216*r[l+3]+(r[l+4]<<16)+(r[l+5]<<8)+r[l+6])>=9e15?crypto.randomBytes(7).copy(r,l):(a.push(s%1e14),l+=7);l=i/7}if(!C)for(;l<i;)(s=o())<9e15&&(a[l++]=s%1e14);for(i=a[--l],e%=h,i&&e&&(s=g[h-e],a[l]=f(i/s)*s);0===a[l];a.pop(),l--);if(l<0)a=[t=0];else{for(t=-1;0===a[0];a.splice(0,1),t-=h);for(l=1,s=a[0];s>=10;s/=10,l++);l<h&&(t-=h-l)}return p.e=t,p.c=a,p}),k.sum=function(){for(var e=1,r=arguments,n=new k(r[0]);e<r.length;)n=n.plus(r[e++]);return n},t=function(){function e(e,r,n,t){for(var i,o,s=[0],u=0,f=e.length;u<f;){for(o=s.length;o--;s[o]*=r);for(s[0]+=t.indexOf(e.charAt(u++)),i=0;i<s.length;i++)s[i]>n-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(r,t,i,o,s){var u,f,c,l,a,h,p,g,d=r.indexOf("."),w=B,m=L;for(d>=0&&(l=q,q=0,r=r.replace(".",""),h=(g=new k(t)).pow(r.length-d),q=l,g.c=e(E(v(h.c),h.e,"0"),10,i,"0123456789"),g.e=g.c.length),c=l=(p=e(r,t,i,s?(u=F,"0123456789"):(u="0123456789",F))).length;0==p[--l];p.pop());if(!p[0])return u.charAt(0);if(d<0?--c:(h.c=p,h.e=c,h.s=o,p=(h=n(h,g,w,m,i)).c,a=h.r,c=h.e),d=p[f=c+w+1],l=i/2,a=a||f<0||null!=p[f+1],a=m<4?(null!=d||a)&&(0==m||m==(h.s<0?3:2)):d>l||d==l&&(4==m||a||6==m&&1&p[f-1]||m==(h.s<0?8:7)),f<1||!p[0])r=a?E(u.charAt(1),-w,u.charAt(0)):u.charAt(0);else{if(p.length=f,a)for(--i;++p[--f]>i;)p[f]=0,f||(++c,p=[1].concat(p));for(l=p.length;!p[--l];);for(d=0,r="";d<=l;r+=u.charAt(p[d++]));r=E(r,c,u.charAt(0))}return r}}(),n=function(){function e(e,r,n){var t,i,o,s,u=0,f=e.length,c=r%d,l=r/d|0;for(e=e.slice();f--;)u=((i=c*(o=e[f]%d)+(t=l*o+(s=e[f]/d|0)*c)%d*d+u)/n|0)+(t/d|0)+l*s,e[f]=i%n;return u&&(e=[u].concat(e)),e}function r(e,r,n,t){var i,o;if(n!=t)o=n>t?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=r[i]){o=e[i]>r[i]?1:-1;break}return o}function n(e,r,n,t){for(var i=0;n--;)e[n]-=i,i=e[n]<r[n]?1:0,e[n]=i*t+e[n]-r[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(t,i,o,s,u){var c,l,p,g,d,w,v,b,y,O,N,E,A,x,S,_,P,R=t.s==i.s?1:-1,D=t.c,B=i.c;if(!(D&&D[0]&&B&&B[0]))return new k(t.s&&i.s&&(D?!B||D[0]!=B[0]:B)?D&&0==D[0]||!B?0*R:R/0:NaN);for(y=(b=new k(R)).c=[],R=o+(l=t.e-i.e)+1,u||(u=a,l=m(t.e/h)-m(i.e/h),R=R/h|0),p=0;B[p]==(D[p]||0);p++);if(B[p]>(D[p]||0)&&l--,R<0)y.push(1),g=!0;else{for(x=D.length,_=B.length,p=0,R+=2,(d=f(u/(B[0]+1)))>1&&(B=e(B,d,u),D=e(D,d,u),_=B.length,x=D.length),A=_,N=(O=D.slice(0,_)).length;N<_;O[N++]=0);P=B.slice(),P=[0].concat(P),S=B[0],B[1]>=u/2&&S++;do{if(d=0,(c=r(B,O,_,N))<0){if(E=O[0],_!=N&&(E=E*u+(O[1]||0)),(d=f(E/S))>1)for(d>=u&&(d=u-1),v=(w=e(B,d,u)).length,N=O.length;1==r(w,O,v,N);)d--,n(w,_<v?P:B,v,u),v=w.length,c=1;else 0==d&&(c=d=1),v=(w=B.slice()).length;if(v<N&&(w=[0].concat(w)),n(O,w,N,u),N=O.length,-1==c)for(;r(B,O,_,N)<1;)d++,n(O,_<N?P:B,N,u),N=O.length}else 0===c&&(d++,O=[0]);y[p++]=d,O[0]?O[N++]=D[A]||0:(O=[D[A]],N=1)}while((A++<x||null!=O[0])&&R--);g=null!=O[0],y[0]||y.splice(0,1)}if(u==a){for(p=1,R=y[0];R>=10;R/=10,p++);V(b,o+(b.e=p+l*h-1)+1,s,g)}else b.e=l,b.r=+g;return b}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,S=/^\.([^.]+)$/,_=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,r,n,t){var i,o=n?r:r.replace(P,"");if(_.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(A,function(e,r,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,t&&t!=i?e:r}),t&&(i=t,o=o.replace(x,"$1").replace(S,"0.$1")),r!=o))return new k(o,i);if(k.DEBUG)throw Error(c+"Not a"+(t?" base "+t:"")+" number: "+r);e.s=null}e.c=e.e=null},R.absoluteValue=R.abs=function(){var e=new k(this);return e.s<0&&(e.s=1),e},R.comparedTo=function(e,r){return b(this,new k(e,r))},R.decimalPlaces=R.dp=function(e,r){var n,t,i,o=this;if(null!=e)return y(e,0,w),null==r?r=L:y(r,0,8),V(new k(o),e+o.e+1,r);if(!(n=o.c))return null;if(t=((i=n.length-1)-m(this.e/h))*h,i=n[i])for(;i%10==0;i/=10,t--);return t<0&&(t=0),t},R.dividedBy=R.div=function(e,r){return n(this,new k(e,r),B,L)},R.dividedToIntegerBy=R.idiv=function(e,r){return n(this,new k(e,r),0,1)},R.exponentiatedBy=R.pow=function(e,r){var n,t,i,o,s,l,a,p,g=this;if((e=new k(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+W(e));if(null!=r&&(r=new k(r)),s=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return p=new k(Math.pow(+W(g),s?2-O(e):+W(e))),r?p.mod(r):p;if(l=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new k(NaN);(t=!l&&g.isInteger()&&r.isInteger())&&(g=g.mod(r))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||s&&g.c[1]>=24e7:g.c[0]<8e13||s&&g.c[0]<=9999975e7)))return o=g.s<0&&O(e)?-0:0,g.e>-1&&(o=1/o),new k(l?1/o:o);q&&(o=u(q/h+2))}for(s?(n=new k(.5),l&&(e.s=1),a=O(e)):a=(i=Math.abs(+W(e)))%2,p=new k(D);;){if(a){if(!(p=p.times(g)).c)break;o?p.c.length>o&&(p.c.length=o):t&&(p=p.mod(r))}if(i){if(0===(i=f(i/2)))break;a=i%2}else if(V(e=e.times(n),e.e+1,1),e.e>14)a=O(e);else{if(0==(i=+W(e)))break;a=i%2}g=g.times(g),o?g.c&&g.c.length>o&&(g.c.length=o):t&&(g=g.mod(r))}return t?p:(l&&(p=D.div(p)),r?p.mod(r):o?V(p,q,L,void 0):p)},R.integerValue=function(e){var r=new k(this);return null==e?e=L:y(e,0,8),V(r,r.e+1,e)},R.isEqualTo=R.eq=function(e,r){return 0===b(this,new k(e,r))},R.isFinite=function(){return!!this.c},R.isGreaterThan=R.gt=function(e,r){return b(this,new k(e,r))>0},R.isGreaterThanOrEqualTo=R.gte=function(e,r){return 1===(r=b(this,new k(e,r)))||0===r},R.isInteger=function(){return!!this.c&&m(this.e/h)>this.c.length-2},R.isLessThan=R.lt=function(e,r){return b(this,new k(e,r))<0},R.isLessThanOrEqualTo=R.lte=function(e,r){return-1===(r=b(this,new k(e,r)))||0===r},R.isNaN=function(){return!this.s},R.isNegative=function(){return this.s<0},R.isPositive=function(){return this.s>0},R.isZero=function(){return!!this.c&&0==this.c[0]},R.minus=function(e,r){var n,t,i,o,s=this,u=s.s;if(r=(e=new k(e,r)).s,!u||!r)return new k(NaN);if(u!=r)return e.s=-r,s.plus(e);var f=s.e/h,c=e.e/h,l=s.c,p=e.c;if(!f||!c){if(!l||!p)return l?(e.s=-r,e):new k(p?s:NaN);if(!l[0]||!p[0])return p[0]?(e.s=-r,e):new k(l[0]?s:3==L?-0:0)}if(f=m(f),c=m(c),l=l.slice(),u=f-c){for((o=u<0)?(u=-u,i=l):(c=f,i=p),i.reverse(),r=u;r--;i.push(0));i.reverse()}else for(t=(o=(u=l.length)<(r=p.length))?u:r,u=r=0;r<t;r++)if(l[r]!=p[r]){o=l[r]<p[r];break}if(o&&(i=l,l=p,p=i,e.s=-e.s),(r=(t=p.length)-(n=l.length))>0)for(;r--;l[n++]=0);for(r=a-1;t>u;){if(l[--t]<p[t]){for(n=t;n&&!l[--n];l[n]=r);--l[n],l[t]+=a}l[t]-=p[t]}for(;0==l[0];l.splice(0,1),--c);return l[0]?H(e,l,c):(e.s=3==L?-1:1,e.c=[e.e=0],e)},R.modulo=R.mod=function(e,r){var t,i,o=this;return e=new k(e,r),!o.c||!e.s||e.c&&!e.c[0]?new k(NaN):!e.c||o.c&&!o.c[0]?new k(o):(9==j?(i=e.s,e.s=1,t=n(o,e,0,3),e.s=i,t.s*=i):t=n(o,e,0,j),(e=o.minus(t.times(e))).c[0]||1!=j||(e.s=o.s),e)},R.multipliedBy=R.times=function(e,r){var n,t,i,o,s,u,f,c,l,p,g,w,v,b,y,O=this,N=O.c,E=(e=new k(e,r)).c;if(!(N&&E&&N[0]&&E[0]))return!O.s||!e.s||N&&!N[0]&&!E||E&&!E[0]&&!N?e.c=e.e=e.s=null:(e.s*=O.s,N&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(t=m(O.e/h)+m(e.e/h),e.s*=O.s,(f=N.length)<(p=E.length)&&(v=N,N=E,E=v,i=f,f=p,p=i),i=f+p,v=[];i--;v.push(0));for(b=a,y=d,i=p;--i>=0;){for(n=0,g=E[i]%y,w=E[i]/y|0,o=i+(s=f);o>i;)n=((c=g*(c=N[--s]%y)+(u=w*c+(l=N[s]/y|0)*g)%y*y+v[o]+n)/b|0)+(u/y|0)+w*l,v[o--]=c%b;v[o]=n}return n?++t:v.splice(0,1),H(e,v,t)},R.negated=function(){var e=new k(this);return e.s=-e.s||null,e},R.plus=function(e,r){var n,t=this,i=t.s;if(r=(e=new k(e,r)).s,!i||!r)return new k(NaN);if(i!=r)return e.s=-r,t.minus(e);var o=t.e/h,s=e.e/h,u=t.c,f=e.c;if(!o||!s){if(!u||!f)return new k(i/0);if(!u[0]||!f[0])return f[0]?e:new k(u[0]?t:0*i)}if(o=m(o),s=m(s),u=u.slice(),i=o-s){for(i>0?(s=o,n=f):(i=-i,n=u),n.reverse();i--;n.push(0));n.reverse()}for((i=u.length)-(r=f.length)<0&&(n=f,f=u,u=n,r=i),i=0;r;)i=(u[--r]=u[r]+f[r]+i)/a|0,u[r]=a===u[r]?0:u[r]%a;return i&&(u=[i].concat(u),++s),H(e,u,s)},R.precision=R.sd=function(e,r){var n,t,i,o=this;if(null!=e&&e!==!!e)return y(e,1,w),null==r?r=L:y(r,0,8),V(new k(o),e,r);if(!(n=o.c))return null;if(t=(i=n.length-1)*h+1,i=n[i]){for(;i%10==0;i/=10,t--);for(i=n[0];i>=10;i/=10,t++);}return e&&o.e+1>t&&(t=o.e+1),t},R.shiftedBy=function(e){return y(e,-p,p),this.times("1e"+e)},R.squareRoot=R.sqrt=function(){var e,r,t,i,o,s=this,u=s.c,f=s.s,c=s.e,l=B+4,a=new k("0.5");if(1!==f||!u||!u[0])return new k(!f||f<0&&(!u||u[0])?NaN:u?s:1/0);if(0==(f=Math.sqrt(+W(s)))||f==1/0?(((r=v(u)).length+c)%2==0&&(r+="0"),f=Math.sqrt(+r),c=m((c+1)/2)-(c<0||c%2),t=new k(r=f==1/0?"1e"+c:(r=f.toExponential()).slice(0,r.indexOf("e")+1)+c)):t=new k(f+""),t.c[0])for((f=(c=t.e)+l)<3&&(f=0);;)if(o=t,t=a.times(o.plus(n(s,o,l,1))),v(o.c).slice(0,f)===(r=v(t.c)).slice(0,f)){if(t.e<c&&--f,"9999"!=(r=r.slice(f-3,f+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(V(t,t.e+B+2,1),e=!t.times(t).eq(s));break}if(!i&&(V(o,o.e+B+2,0),o.times(o).eq(s))){t=o;break}l+=4,f+=4,i=1}return V(t,t.e+B+1,L,e)},R.toExponential=function(e,r){return null!=e&&(y(e,0,w),e++),z(this,e,r,1)},R.toFixed=function(e,r){return null!=e&&(y(e,0,w),e=e+this.e+1),z(this,e,r)},R.toFormat=function(e,r,n){var t,i=this;if(null==n)null!=e&&r&&"object"==typeof r?(n=r,r=null):e&&"object"==typeof e?(n=e,e=r=null):n=G;else if("object"!=typeof n)throw Error(c+"Argument not an object: "+n);if(t=i.toFixed(e,r),i.c){var o,s=t.split("."),u=+n.groupSize,f=+n.secondaryGroupSize,l=n.groupSeparator||"",a=s[0],h=s[1],p=i.s<0,g=p?a.slice(1):a,d=g.length;if(f&&(o=u,u=f,f=o,d-=o),u>0&&d>0){for(o=d%u||u,a=g.substr(0,o);o<d;o+=u)a+=l+g.substr(o,u);f>0&&(a+=l+g.slice(o)),p&&(a="-"+a)}t=h?a+(n.decimalSeparator||"")+((f=+n.fractionGroupSize)?h.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):a}return(n.prefix||"")+t+(n.suffix||"")},R.toFraction=function(e){var r,t,i,o,s,u,f,l,a,p,d,w,m=this,b=m.c;if(null!=e&&(!(f=new k(e)).isInteger()&&(f.c||1!==f.s)||f.lt(D)))throw Error(c+"Argument "+(f.isInteger()?"out of range: ":"not an integer: ")+W(f));if(!b)return new k(m);for(r=new k(D),a=t=new k(D),i=l=new k(D),w=v(b),s=r.e=w.length-m.e-1,r.c[0]=g[(u=s%h)<0?h+u:u],e=!e||f.comparedTo(r)>0?s>0?r:a:f,u=U,U=1/0,f=new k(w),l.c[0]=0;p=n(f,r,0,1),1!=(o=t.plus(p.times(i))).comparedTo(e);)t=i,i=o,a=l.plus(p.times(o=a)),l=o,r=f.minus(p.times(o=r)),f=o;return o=n(e.minus(t),i,0,1),l=l.plus(o.times(a)),t=t.plus(o.times(i)),l.s=a.s=m.s,d=n(a,i,s*=2,L).minus(m).abs().comparedTo(n(l,t,s,L).minus(m).abs())<1?[a,i]:[l,t],U=u,d},R.toNumber=function(){return+W(this)},R.toPrecision=function(e,r){return null!=e&&y(e,1,w),z(this,e,r,2)},R.toString=function(e){var r,n=this,i=n.s,o=n.e;return null===o?i?(r="Infinity",i<0&&(r="-"+r)):r="NaN":(null==e?r=o<=I||o>=M?N(v(n.c),o):E(v(n.c),o,"0"):10===e?r=E(v((n=V(new k(n),B+o+1,L)).c),n.e,"0"):(y(e,2,F.length,"Base"),r=t(E(v(n.c),o,"0"),10,e,i,!0)),i<0&&n.c[0]&&(r="-"+r)),r},R.valueOf=R.toJSON=function(){return W(this)},R._isBigNumber=!0,null!=r&&k.set(r),k}()).default=o.BigNumber=o,void 0===(t=function(){return o}.call(r,n,r,e))||(e.exports=t)}()}]);


function Main(input) {
  input = input.trim()
  var [a,b,c] = input.split(" ").map(BigInt);
  console.log(((b/c)-(a==0?0n:a-1n)/c+((a==0n)?1n:0n)).toString())
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  input = input.trim()
  var [a,b,c] = input.split(" ").map(BigInt);
  console.log(((b/c)-(a==0?0n:a-1n)/c).toString())

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


function Main(input) {
  input = input.trim()
  var [a,b,c] = input.split(" ").map(BigInt);
  console.log(((b/c)-(a==0?0:a-1n)/c).toString())

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


function Main(input) {
  input = input.trim()
  var [a,b,c] = input.split(" ").map(BigInt);
  if(a==0)a=1n
  console.log(((b/c)-(a-1n)/c).toString())

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


package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	A, B, K := nextInt(), nextInt(), nextInt()
	AV, BV := A/K, B/K
	if A%K == 0 {
		AV--
	}
	fmt.Fprintln(out, BV-AV)
}

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"reflect"
	"sort"
	"strconv"
	"strings"
	// "regexp"
)

/* sort */
type pair struct {
	index  int64
	p1, p2 interface{}
}
type pairs []pair

func (slice pairs) Len() int {
	return len(slice)
}

func (slice pairs) Less(i, j int) bool {
	return slice[i].index < slice[j].index
}

func (slice pairs) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

/* sort */
type Int64Slice []int64

func (slice Int64Slice) Len() int {
	return len(slice)
}

func (slice Int64Slice) Less(i, j int) bool {
	return slice[i] < slice[j]
}

func (slice Int64Slice) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}
func Int64s(a []int64)                    { sort.Sort(Int64Slice(a)) }
func Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8
	INF            = 1e8
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
	di      = []int64{-1, 0, 1, 0}
	dj      = []int64{0, -1, 0, 1}
	di8     = []int64{-1, -1, 0, 1, 1, 1, 0, -1}
	dj8     = []int64{0, -1, -1, -1, 0, 1, 1, 1}
)

func main() {
	buf := make([]byte, initialBufSize)
	scanner.Buffer(buf, maxBufSize)
	scanner.Split(bufio.ScanWords)
	a, b, x := readInt(), readInt(), readInt()
	ans := int64(0)
	bs := b / x
	as := a / x
	ans = bs - as
	if a%x == 0 {
		ans++
	}
	fmt.Println(ans)
}

/*==========================================
 *             Library
 *==========================================*/
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
}
func doubleAry(h int64, w int64, init int64) (res [][]int64) {
	res = make([][]int64, h)
	for i := int64(0); i < h; i++ {
		res[i] = make([]int64, w)
		for j := int64(0); j < w; j++ {
			res[i][j] = init
		}
	}
	return
}

func aryEq(a []int64, b []int64) bool {
	return reflect.DeepEqual(a, b)
}

func clone(n []int64) (r []int64) {
	r = make([]int64, len(n))
	for i := 0; i < len(n); i++ {
		r[i] = n[i]
	}
	return
}
func write(s string) {
	writer.WriteString(s)
}

func print() {
	writer.Flush()
}

// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可
func readLine() (s string) {
	if scanner.Scan() {
		s = scanner.Text()
	}
	return s
}

func readInt() (read int64) {
	scanner.Scan()
	read, err := strconv.ParseInt(scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return
}

func readFloat() (read float64) {
	scanner.Scan()
	read, err := strconv.ParseFloat(scanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return
}

func readRunes() (read []rune) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, v)
	}
	return
}

func readString() (read string) {
	scanner.Scan()
	read = scanner.Text()
	return
}

func readStrings() (read []string) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, string(v))
	}
	return
}

func s2i(s string) int64 {
	var intVal, e = strconv.ParseInt(s, 10, 64)
	if e != nil {
		panic(e)
	}
	return intVal
}

func i2s(i int64) string {
	var strVal = strconv.FormatInt(i, 10)
	return strVal
}

func s2f(s string) float64 {
	var floatVal, e = strconv.ParseFloat(s, 64)
	if e != nil {
		panic(e)
	}
	return floatVal
}

func abs(i int64) int64 {
	return int64(math.Abs(float64(i)))
}

func max(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans < v {
			ans = v
		}
	}
	return ans
}
func min(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans > v {
			ans = v
		}
	}
	return ans
}

func sum(i []int64) int64 {
	sum := int64(0)
	for _, val := range i {
		sum += val
	}
	return sum
}

func split(s string) []string {
	return strings.Fields(s)
}

func strAry2intAry(strs []string) []int64 {
	var ret = make([]int64, 0, len(strs))
	for _, str := range strs {
		var intVal = s2i(str)
		ret = append(ret, intVal)
	}
	return ret
}

func intAry2strAry(nums []int64) []string {
	var ret = make([]string, 0, len(nums))
	for _, num := range nums {
		var strVal = i2s(num)
		ret = append(ret, strVal)
	}
	return ret
}

func ary2str(strs []string) string {
	return strings.Join(strs, " ")
}

func reverse(res []int64) []int64 {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}
func reverseStr(res []string) []string {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}

func ini(res []int, init int) {
	if len(res) == 0 {
		return
	}
	res[0] = init
	for i := 0; i < len(res); i++ {
		copy(res[i:], res[:i])
	}
}

//
// func regexpExample() {
//     // Your code here!
//     var str = "13:20"
//     r := regexp.MustCompile(`(\d+):(\d+)`)
//     fmt.Println(r.FindStringSubmatch(str))
// }

// type Country struct {
//     gold int
//     silver int
//     blonze int
// }

// // 複数ソートのサンプル
// func stableSortExample() []Country{
//     var country = []Country {
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:3, blonze:2},
//         {gold:1, silver:3, blonze:3},
//     }
//     sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })
//     return country
// }


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() {
	a := getInt()
	b := getInt()
	x := getInt()

	result := b/x - a/x
	if a % x == 0 {
		result++
	}
	fmt.Println(result)
}

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))
}

func primeFactors(n int) [] int {
	factors := make([]int, 0)
	i := 2
	for i * i <= n {
		r := n % i
		if r != 0 {
			i += 1
		} else if r == 0 {
			n /= i
			factors = append(factors, i)
		}
	}
	if n > 1 {
		factors = append(factors, n)
	}
	return factors
}


package main

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

var sc = bufio.NewScanner((os.Stdin))

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

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

func main() {
	sc.Split(bufio.ScanWords)
	a, b, x := nextInt(), nextInt(), nextInt()

	fmt.Printf("%d\n", ABC048B(a, b, x))
}

// ABC048B ...
func ABC048B(a, b, x int) (res int) {
	if a == 0 {
		res++
	}
	res += b/x - (a-1)/x

	return
}


package main

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

var sc = bufio.NewScanner((os.Stdin))

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

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

func main() {
	sc.Split(bufio.ScanWords)
	a, b, x := nextInt(), nextInt(), nextInt()

	fmt.Printf("%d\n", ABC048B(a, b, x))
}

// ABC048B ...
func ABC048B(a, b, x int) int {
	return b/x - (a-1)/x
}


package main

import "fmt"

func main() {
	// Code for B - Between a and b ...
	var a, b, x int
	fmt.Scanf("%d %d %d", &a, &b, &x)

	ans := (b/x + 1) - ((a-1)/x + 1)
	fmt.Println(ans)
}


a, b, x = gets.split.map(&:to_i)
s, t = a.divmod(x)
puts b / x - s + (t == 0 ? 1 : 0)


a, b, x = gets.chomp.split.map(&:to_i)
lb = (a + x - 1) / x * x
ub = b / x * x
puts (lb > b || ub < a)? "0" : (ub - lb) / x + 1


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

num_a = (a - 1) / x
num_b = b / x

if 0 < a
  puts num_b - num_a
else
  puts num_b + 1 # 個数を見ている
end


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

l = a / x
m = b / x
if l % x == 0
  puts m - l + 1
else
  puts m - l
end


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

puts b / x - [0, a - 1].max / x


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

puts b / x - [0, a - 1].min / x


// Your code here!
use std::io::*;
use std::str::FromStr;

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")
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

fn main(){
    let nums:Vec<i64> = read_vec();
    let mut a:i64 = nums[0];
    let mut b:i64 = nums[1];
    let mut x:i64 = nums[2];

    println!("{}",b/x-a/x + (if a%x==0 {1} else {0}));

}


#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

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

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let a: usize = sc.get();
    let b: usize = sc.get();
    let x: usize = sc.get();
    let ans;
    if a > 0 {
        ans = b / x - (a-1) / x;
    } else {
        ans = b / x + 1;
    }
    println!("{}", ans);
}


use std::io;

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<u64> = procon_read();
	let a = v[0];
	let b = v[1];
	let x = v[2];
	if a == 0 {
		println!("{}", b/x + 1);
	}else{
		println!("{}", b/x + 1 - (a - 1)/x - 1);
	}
}


fn main() {
    proconio::input! {
    a:isize,
    b:isize,
    c:isize,
    }
    println!("{}",b/c-(a-1)/c)
}


use proconio::input;

fn main() {
    input! {
        a: i64,
        b: i64,
        x: i64,
    };
    let x_a = (a - 1) / x;
    let x_b = b / x;
    let ans = x_b - x_a;
    println!("{}", ans);
}


use std::io;

fn main() {
    let mut input_line:String = String::new();
    io::stdin().read_line(&mut input_line).expect("err");

    let inputs: Vec<&str> = input_line.split_whitespace().collect();

    let a = inputs[0].parse::<i64>().unwrap();
    let b = inputs[1].parse::<i64>().unwrap();
    let x = inputs[2].parse::<i64>().unwrap();

    let mut ans: i64 = f(b, x)-f(a-1, x);

    print!("{}", ans);
}

fn f(n: i64, x: i64) -> i64 {
   if n == -1{
       return -1;
   }else{
       return (n/x)+1;
   }
}


let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (a, b, x) = (input[0], input[1], input[2])
print(b/x-(a>0 ?(a-1)/x:-1))


let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (a, b, x) = (input[0], input[1], input[2])
print(a>0 ?b/x-(a-1)/x:b/x+1)


let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (a, b, x) = (input[0], input[1], input[2])
print(b/x-(a-1)/(a>0 ?x:1))


let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (a, b, x) = (input[0]-1, input[1], input[2])
print(a>0 ?b/x-a/x:b/x+1)


extension String: CollectionType {
    func toInts() -> [Int] {
        return self.split(" ").map {Int($0)!}
    }

    func toUInts() -> [UInt64] {
        return self.split(" ").map {UInt64($0)!}
    }

    func toStrings() -> [String] {
        return self.split(" ")
    }
}

let values = readLine()!.toUInts()
let a = values[0]
let b = values[1]
let x = values[2]

let adjust: UInt64 = a % x == 0 ? 1 : 0

print((b - a) / x + adjust)


extension String: CollectionType {
    func toInts() -> [Int] {
        return self.split(" ").map {Int($0)!}
    }

    func toUInts() -> [UInt] {
        return self.split(" ").map {UInt($0)!}
    }

    func toStrings() -> [String] {
        return self.split(" ")
    }
}

let values = readLine()!.toUInts()
let a = values[0]
let b = values[1]
let x = values[2]

let adjust: UInt = a % x == 0 ? 1 : 0

print((b - a) / x + adjust)


((input: string): void => {
    const [D, L] = [24, 3];
    const new64 = (n) => [n % (1<<D), (n / (1<<D)) | 0, 0]

    const mul64s = (a, b) => {
        let r = [];
        let x = 0;
        for (let i = 0; i < L; i++) {
            x = a[i] * b + x;
            r[i] = x % (1<<D);
        x = Math.floor(x / (1<<D));
        }
        return r;
    }

    const add64s = (a, b) => {
        let r = [];
        let x = b;
        for (let i = 0; i < L; i++) {
            x = a[i] + x;
            r[i] = x % (1<<D);
            x = Math.floor(x / (1<<D));
        }
        return r;
    }

    const cmp64 = (a, b) => {
        for (let i = L-1; i >= 0; i--) {
            if (a[i] < b[i]) return -1;
            if (a[i] > b[i]) return 1;
        }
        return 0;
    }

    const add64 = (a, b) => {
        let r = [];
        let x = 0;
        for (let i = 0; i < L; i++) {
            x = a[i] + b[i] + x;
            r[i] = x % (1<<D);
            x = Math.floor(x / (1<<D));
        }
        return r;
    }

    const sub64 = (a, b) => {
        let r = [];
        let x = 0;
        for (let i = 0; i < L; i++) {
            x = a[i] - b[i] - x;
            let borrow = 0;
            while (x < 0) {
                x += (1<<D);
                borrow++;
            }
            r[i] = x % (1<<D);
            x = borrow;
        }
        return r;
    }

    const div64s = (a, b) => {
        let x = 0;
        for (let i = L-1; i >= 0; i--) {
            x = a[i] + x * (1<<D);
            a[i] = (x / b) | 0;
            x = x % b;
        }
        return x;
    }

    const copy64 = (a, b) => {
        for (let i = 0; i < L; i++) {
            a[i] = b[i];
        }
    }

    const shiftL64 = (a) => {
        const msb = [0, 0, (1<<(D-1))];
        let d = a;
        let r = 0;
        if (cmp64(a, msb) >= 0) {
            r = 1;
            d = sub64(a, msb);
        }
        let c = add64(d, d);
        copy64(a, c);
        return r;
    }

    const div64 = (a, b) => {
        let d = new64(0);
        let x = a.slice();
        let r = new64(0);
        for (let i = 0; i < L*D; i++) {
            let bit = shiftL64(x);
            shiftL64(d);
            d = add64s(d, bit);
            let y = 0;
            if (cmp64(d, b) >= 0) {
                d = sub64(d, b);
                y = 1;
            }
            shiftL64(r);
            r = add64s(r, y);
        }
        return r;
    }

    const parse64 = (s) => {
        const l = s.length;
        let a = new64(0);
        for (let i = 0; i < l; i++) {
            a = mul64s(a, 10);
            a = add64s(a, parseInt(s.substr(i, 1), 10));
        }
        return a;
    }

    const print64 = (a) => {
        let s = "";
        let x = a.slice();
        while (cmp64(x, new64(0)) !== 0) {
            s += div64s(x, 10);
        }
        if (s === "") {
            s = "0";
        }
        console.log(s.split('').reverse().join(''));
    }

    const divisors = (a, x) => add64s(div64(a, x), 1);

    const solve = (a, b, x) => sub64(divisors(b, x), (cmp64(a, new64(1)) >= 0 ? divisors(sub64(a, new64(1)), x) : new64(0)));

    const args = input.trim().split(' ');
    const a = parse64(args[0]);
    const b = parse64(args[1]);
    const x = parse64(args[2]);
    const c = solve(a, b, x);
    print64(c);
})(require('fs').readFileSync('/dev/stdin', 'utf8'));


import { readFileSync } from "fs";

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

const main = (input: string[][]) => {
  const [a, b, x] = input[0].map(BigInt);

  if (a === 0n) {
    return (b / x + 1n).toString();
  } else {
    return (b / x - (a - 1n) / x).toString();
  }
};

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