#include <cstdio>
using namespace std;

struct quickin {
	bool fl = false;
	quickin operator>>(register int &n) {
		if (fl) return *this;
		register bool f = false;
		register char ch;
		while (ch = getchar(), ch > '9' || ch < '0') {
			if (!(ch ^ EOF)) {
				fl = true;
				return *this;
			}
			f = !(ch ^ '-');
		}
		n = ch ^ '0';
		while (ch = getchar(), ch >= '0' && ch <= '9')
			n = (n << 1) + (n << 3) + (ch ^ '0');
		if (f) n = -n;
		if (!(ch ^ EOF)) fl = true;
		return *this;
	}
	quickin operator>>(register unsigned &n) {
		register char ch;
		while (ch = getchar(), ch > '9' || ch < '0')
			if (!(ch ^ EOF)) {
				fl = true;
				return *this;
			}
		n = ch ^ '0';
		while (ch = getchar(), ch >= '0' && ch <= '9')
			n = (n << 1) + (n << 3) + (ch ^ '0');
		if (!(ch ^ EOF)) fl = true;
		return *this;
	}
	quickin operator>>(register long long &n) {
		register bool f = false;
		register char ch;
		while (ch = getchar(), ch > '9' || ch < '0') {
			if (!(ch ^ EOF)) {
				fl = true;
				return *this;
			}
			f = !(ch ^ '-');
		}
		n = ch ^ '0';
		while (ch = getchar(), ch >= '0' && ch <= '9')
			n = (n << 1) + (n << 3) + (ch ^ '0');
		if (f) n = -n;
		if (!(ch ^ EOF)) fl = true;
		return *this;
	}
	quickin operator>>(register unsigned long long &n) {
		register char ch;
		while (ch = getchar(), ch > '9' || ch < '0')
			if (!(ch ^ EOF)) {
				fl = true;
				return *this;
			}
		n = ch ^ '0';
		while (ch = getchar(), ch >= '0' && ch <= '9')
			n = (n << 1) + (n << 3) + (ch ^ '0');
		if (!(ch ^ EOF)) fl = true;
		return *this;
	}
	quickin operator>>(register float &n) {
		register bool f = false;
		register char ch;
		while (ch = getchar(), ch > '9' || ch < '0') {
			if (!(ch ^ EOF)) {
				fl = true;
				return *this;
			}
			f = !(ch ^ '-');
		}
		n = ch ^ '0';
		while (ch = getchar(), ch >= '0' && ch <= '9')
			n = n * 10 + (ch ^ '0');
		if (!(ch ^ '.')) {
			double sum = 0.1;
			while (ch = getchar(), ch >= '0' && ch <= '9') {
				n += (ch ^ '0') * sum;
				sum *= 0.1;
			}
		}
		if (f) n = -n;
		if (!(ch ^ EOF)) fl = true;
		return *this;
	}
	quickin operator>>(register double &n) {
		register bool f = false;
		register char ch;
		while (ch = getchar(), ch > '9' || ch < '0') {
			if (!(ch ^ EOF)) {
				fl = true;
				return *this;
			}
			f = !(ch ^ '-');
		}
		n = ch ^ '0';
		while (ch = getchar(), ch >= '0' && ch <= '9')
			n = n * 10 + (ch ^ '0');
		if (!(ch ^ '.')) {
			double sum = 0.1;
			while (ch = getchar(), ch >= '0' && ch <= '9') {
				n += (ch ^ '0') * sum;
				sum *= 0.1;
			}
		}
		if (f) n = -n;
		if (!(ch ^ EOF)) fl = true;
		return *this;
	}
	quickin operator>>(register char &ch) {
		while (ch = getchar(), !(ch ^ '\r') || !(ch ^ '\n') || !(ch ^ ' ') || !(ch ^ EOF));
		if (!(ch ^ EOF)) fl = true;
		return *this;
	}
	bool operator!=(register int x) {
		if (fl && !(x ^ EOF)) return false;
		else return true;
	}
	quickin operator>>(char st[]) {
		while ((*st = getchar()) ^ '\n' && *st ^ '\r' && *st ^ ' ' && *st ^ EOF) ++st;
		if (!(*st ^ EOF)) fl = true;
		*st = '\0';
		return *this;
	}
} qin;

int main() {
	register long long a, b, x;
	qin >> a >> b >> x;
	printf("%lld", !(a % x) ? b / x - a / x + 1 : b / x - a / x);
	return 0;
}

Measured memory_bytes: 128