jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

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

//Util
func nextStr() 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 maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}

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

func absFloat64(a float64) float64 {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func maxFloat64(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minFloat64(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

func str2Int(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}

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 powInt(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	if x == 2 {
		return true
	}
	if x%2 == 0 {
		return false
	}

	b := true
	rootx := int(math.Sqrt(float64(x)))
	i := 3
	for i <= rootx {
		if x%i == 0 {
			b = false
			break
		}
		i += 2
	}
	return b
}

func PrimeFactors(n int) (pfs []int) {
	// Get the number of 2s that divide n
	for n%2 == 0 {
		pfs = append(pfs, 2)
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			pfs = append(pfs, i)
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs = append(pfs, n)
	}

	return
}

func sumInts(x []int) int {

	total := 0
	for _, v := range x {
		total += v
	}

	return total
}

//Main
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)
		return sc
	}()
)

var N, D int

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

	N, D = nextInt(), nextInt()
	x := make([][]int, N)
	for i := 0; i < N; i++ {
		x[i] = make([]int, D)
		for j := 0; j < D; j++ {
			x[i][j] = nextInt()
		}
	}

	ans := 0
	for i := 0; i < N; i++ {
		for j := i + 1; j < N; j++ {
			d2 := 0
			for d := 0; d < D; d++ {
				//fmt.Println(i, j, d)
				d2 += powInt(x[i][d]-x[j][d], 2)
			}

			d2f := float64(d2)

			if math.Sqrt(d2f) == float64(int(math.Sqrt(d2f))) {
				ans++
			}
		}
	}

	fmt.Println(ans)
}
//  [go]
package main

import (
	"fmt"
	"math"
	_ "sort"
)

func main() {
	var n, d int
	fmt.Scan(&n, &d)
	x := make([][]int, n) //スライス
	for i := 0; i < n; i++ {
		x[i] = make([]int, d)
		for j := 0; j < d; j++ {
			fmt.Scan(&x[i][j])
		}
	}

	cnt := 0

	for i := 0; i < n-1; i++ {
		for j := i + 1; j < n; j++ {
			dist := 0.0
			for k := 0; k < d; k++ {
				dist += float64((x[i][k] - x[j][k]) * (x[i][k] - x[j][k]))
			}
			dist = math.Sqrt(dist)
			if math.Floor(dist) == dist {
				cnt++
			}
		}
	}
	fmt.Println(cnt)
}
//  [go]
package main

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

var (
	read  = bufio.NewReader(os.Stdin)
	write = bufio.NewWriter(os.Stdout)
)

func min(a, b int) int {
	if a <= b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a >= b {
		return a
	}
	return b
}

func yesno(result bool) {
	if result {
		fmt.Fprintln(write, "Yes")
	} else {
		fmt.Fprintln(write, "No")
	}
}

func printansStr(result bool, a, b string) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func printansInt(result bool, a, b int) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func main() {
	defer write.Flush()

	var n, d int
	fmt.Fscan(read, &n, &d)

	x := make([][]float64, n)
	for i := 0; i < n; i++ {
		x[i] = make([]float64, d)
		for j := 0; j < d; j++ {
			fmt.Fscan(read, &x[i][j])
		}
	}

	cnt := 0
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			var dist float64
			dist = 0.0
			for k := 0; k < d; k++ {
				dist += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k])
			}
			dist = math.Sqrt(dist)
			if math.Ceil(dist) == math.Floor(dist) {
				cnt++
			}
		}
	}
	fmt.Fprintln(write, cnt)
}
//  [go]
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	fmt.Println(resolve(parseProblem()))
}

func parseProblem() int {
	n, d := scanInt(sc), scanInt(sc)
	ds := make([][]int, n)
	for i := range loop0(n) {
		ds[i] = make([]int, d)
		for j := range loop0(d) {
			ds[i][j] = scanInt(sc)
		}
	}
	num := 0
	t := squreNums(160000)
	for i := range loop0(n) {
		for j := i + 1; j < n; j++ {
			sum := 0
			for k := 0; k < d; k++ {
				df := ds[i][k] - ds[j][k]
				sum += df * df
			}
			if t[sum] {
				num++
			}
		}
	}
	return num
}

func loop0(n int) chan int {
	return loop(0, n-1, 1)
}

func loop1(n int) chan int {
	return loop(1, n, 1)
}

func loop(s, e, d int) chan int {
	ch := make(chan int)
	go func() {
		for i := s; i <= e; i += d {
			ch <- i
		}
		close(ch)
	}()
	return ch
}

func squreNums(max int) []bool {
	t := make([]bool, max)
	for i := 1; i*i <= max; i++ {
		t[i*i] = true
	}
	return t
}

func resolve(n int) int {
	return n
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	fmt.Println(resolve(parseProblem()))
}

func parseProblem() int {
	n, d := scanInt(sc), scanInt(sc)
	ds := make([][]int, n)
	for i := range loop0(n) {
		ds[i] = make([]int, d)
		for j := range loop0(d) {
			ds[i][j] = scanInt(sc)
		}
	}
	num := 0
	t := squreNums(4000)
	for i := range loop0(n) {
		for j := i + 1; j < n; j++ {
			sum := 0
			for k := 0; k < d; k++ {
				df := ds[i][k] - ds[j][k]
				sum += df * df
			}
			if t[sum] {
				num++
			}
		}
	}
	return num
}

func loop0(n int) chan int {
	return loop(0, n-1, 1)
}

func loop1(n int) chan int {
	return loop(1, n, 1)
}

func loop(s, e, d int) chan int {
	ch := make(chan int)
	go func() {
		for i := s; i <= e; i += d {
			ch <- i
		}
		close(ch)
	}()
	return ch
}

func squreNums(max int) []bool {
	t := make([]bool, max)
	for i := 1; i*i <= max; i++ {
		t[i*i] = true
	}
	return t
}

func resolve(n int) int {
	return n
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

import "fmt"
import "math"

func main(){
	var D, N int
	var X[200][200] float64
	var tmp float64
	var sqrt float64
	var count int

	fmt.Scan(&N, &D)

	for i := 0 ; i < N ; i++ {
		for j := 0 ; j < D ; j++{
			fmt.Scan(&X[i][j])
		}
	}
	
/*	for i := 0 ; i < N ; i++ {
		sqrt = 0
		for j := 1 ; j < D ; j++ {
			sqrt += (X[i][j] - X[(i+j)%N][j])*(X[i][j] - X[(i+j)%N][j])
		//	fmt.Printf("%f ", sqrt)
		}
		sqrt = math.Sqrt(sqrt)
		// fmt.Println(sqrt)
		tmp = math.Ceil(sqrt)
	//	fmt.Println(tmp, sqrt)
		if(tmp == sqrt){
			count++
		}
	}*/

	for i := 0 ; i < N ; i++ {
		for k := i+1 ; k < N ; k++{
			sqrt = 0
			for j := 0 ; j < D ; j++{
				sqrt += (X[i][j] - X[i+k][j])*(X[i][j] - X[i+k][j])
		//		fmt.Printf("(%f %f)", X[i][j], X[i+k][j])
			}
			sqrt = math.Sqrt(sqrt)
			tmp = math.Ceil(sqrt)
			if tmp == sqrt {
				count++
			}
		//	fmt.Println(sqrt)
		}
	}
	fmt.Println(count)
}
//  [ruby]
line = gets.split(' ').map(&:to_i)
n = line[0]
d = line[1]

lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end
kazu = 0
for i in 0..n-1 do
  for j in 0..n-1 do
    if i == j then
      break
    end
    g = 0
    for k in 0..d-1 do
      g+=(lines[i][k]-lines[j][k])**2
    end
    g = g**0.5
    aho = g.ceil
    if g == aho then
      kazu+=1
    end
  end
end
puts kazu
//  [ruby]
# https://atcoder.jp/contests/abc133/tasks/abc133_b


N, D = gets.split.map(&:to_i)
Xss = Array.new(N) { gets.split.map(&:to_i) }

d2s = Xss.combination(2).map do |xs1, xs2|
  xs1.zip(xs2).reduce(0) { |memo, (y, z)| memo + (y - z) ** 2 }
end

ans = d2s.count do |d2|
  d = Math.sqrt(d2).floor
  d ** 2 == d2
end

puts ans
//  [ruby]
# 6:05
n, d = gets.to_s.split.map{|t|t.to_i}
x = Array.new(n){ gets.to_s.split.map{|t|t.to_i} }

def distance(p_i, p_j)
  
  dist = 0
  p_i.each_with_index do |x, i|
    dist += (x-p_j[i]) ** 2
  end
  dist
end

cnt = 0
n.times do |j|
  j.times do |i|
    dist = distance(x[i], x[j])
    cnt += 1 if dist == ((dist**0.5).round ** 2)
  end
end

puts cnt
//  [ruby]
n, d = gets.strip.split.map(&:to_i)

arr = []

n.times do |a|
    arr << gets.strip.split.map(&:to_i)
end

# (n * (n - 1) / 2).times do |j|
    # n.times do |k|
    #     p arr[k]
    # end
# end 

ans = 0

(0..(n - 1)).each do |i|
    ((i + 1)..(n - 1)).each do |j|
        norm = 0

        (0..(d - 1)).each do |k|
            diff = arr[i][k] - arr[j][k]
            norm += diff * diff
        end

        if k * k == norm
            ans += 1
        end

        # flag = false

        # (0..norm).each do |k|
        #     flag = true if k * k == norm
        # end

        # ans += 1 if flag
    end
end

puts ans
//  [ruby]
n, d = gets.chomp.split(' ').map(&:to_i)
list = []
count = 0

n.times do
  list << gets.chomp.split(' ').map(&:to_i)
end

(n-1).times do |i|
  pop = list[i]
  (i..(n-1)).each do |j|
    pop2 = list[j]
    sum = 0
    d.times do |k|
      sum += ((pop[k] - pop2[k]) ** 2)
    end
	sum = (sum**(1/2.0))
	if sum.to_s =~ /[1-9]\.?[0]+$/
      count += 1
    end
  end
end

print count
//  [ruby]
n, d = gets.chomp.split(' ').map(&:to_i)
list = []
count = 0

n.times do
  list << gets.chomp.split(' ').map(&:to_i)
end

(n-1).times do |i|
  pop = list[i]
  (i..(n-1)).each do |j|
    pop2 = list[j]
    sum = 0
    d.times do |k|
      sum += ((pop[k] -pop2[k]) ** 2)
    end
	sum = (sum**(1/2.0))
	if sum.to_s =~ /[1-9]\.?[0]+$/
      count += 1
    end
  end
end

print count
//  [rust]
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 distance(a: &[f64], b: &[f64]) -> f64 {
    a.iter().zip(b.iter()).map(|(i,j)| {
        (i-j).powf(2.0)
    }).sum::<f64>().sqrt()
}

pub fn is_integer(f: f64) -> bool {
    f - f.floor() == 0.0
}

fn main() {
    input! {
        n: usize,
        d: usize,
        x: [[f64; d]; n],
    }
    let mut cnt = 0;
    for i in 0..n {
        for j in i+1..n {
            let dis = distance(&x[i], &x[j]);
            if is_integer(dis) { cnt+=1 }
        }
    }
    println!("{}", cnt);
}
//  [rust]
fn main() {
    let nd = read_vec::<usize>();
    let n = nd[0];
    let d = nd[1];
    let points = read_vec2::<f64>(n);

    let mut ret = 0;
    for i in 0..n-1 {
        for j in i+1..n {
            let p1 = &points[i];
            let p2 = &points[j];
            let mut dis = 0.0;
            for k in 0..d {
                dis += (p1[k] - p2[k]) * (p1[k] - p2[k]);
            }
            dis = dis.sqrt();
            if dis - dis.floor() == 0.0 {
                ret += 1;
            }
        }
    }

    println!("{}", ret);
}

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 read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    let mut v2 = Vec::new();
    for _ in 0..n {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).ok();
        let v = s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect();
        v2.push(v);
    }
    v2
}
//  [rust]
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let mut iter = buf.split_whitespace();
	let n = iter.next().unwrap().parse::<i32>().ok().unwrap();
	let d = iter.next().unwrap().parse::<i32>().ok().unwrap();
	let mut v :Vec<Vec<i32>> = Vec::new();
	for i in 0..n {
		v.push(Vec::new());
		let mut buf = String::new();
		io::stdin().read_line(&mut buf).expect("");
		let mut iter = buf.split_whitespace();
		for j in iter {
			v[i as usize].push(j.parse::<i32>().ok().unwrap());
		}
	}
	
	let mut cnt = 0;
	for i in 0..n {
		for j in (i+1)..n {
			let mut dis:i32 = 0;
			for k in 0..d {
				dis += (v[ j as usize][k as usize] - v[i as usize][k as usize])*(v[j as usize][k as usize] - v[i as usize][k as usize]);
			}
			let mut k = 0;
			while(k <= dis){
				if k*k == dis {
					cnt += 1;
					break;
				}
				k += 1;
			}
		}
	}
	println!("{}", cnt);
}
//  [rust]
#[allow(unused_imports)]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input!(n: usize, d: usize, x: [[isize; d]; n]);

    let mut ar = Vec::new();
    for i in 0..50 {
        ar.push(i * i);
    }

    let mut count = 0;

    for i in 0..n {
        for j in i + 1..n {
            let mut sum = 0;
            for k in 0..d {
                sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
            }
            if ar.contains(&sum) {
                count += 1;
            }
        }
    }
    println!("{}", count);
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        n:usize,d:usize,
        x:[[i64;d];n],
    }
    let mut nijos = BTreeSet::new();
    for i in 0..50 {
        nijos.insert(i * i);
    }
    let mut ans = 0;
    for i in 0..n {
        for j in i + 1..n {
            let mut root = 0;
            for ten in 0..d {
                root += (x[i][ten] - x[j][ten]) * (x[i][ten] - x[j][ten]);
            }
            if nijos.contains(&root) {
                ans += 1;
            }
        }
    }
    println!("{}", ans);
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        n:usize,d:usize,
        x:[[i64;d];n],
    }
    let mut nijos = BTreeSet::new();
    for i in 0..25 {
        nijos.insert(i * i);
    }
    let mut ans = 0;
    for i in 0..n {
        for j in i + 1..n {
            let mut root = 0;
            for ten in 0..d {
                root += (x[i][ten] - x[j][ten]) * (x[i][ten] - x[j][ten]);
            }
            if nijos.contains(&root) {
                ans += 1;
            }
        }
    }
    println!("{}", ans);
}
//  [swift]
import Foundation
 
let array = readLine()!.componentsSeparatedByString(" ")
let numOfPoints = Int(array[0])!
let dimension = Int(array[1])!
var points: [[Int]] = [[Int]]()
var countInt = 0
 
for i in 0...numOfPoints-1 {
  let array = readLine()!.componentsSeparatedByString(" ")
  var tmpIntArray: [Int] = [Int]()
  for elem in array {
    tmpIntArray.append(Int(elem)!)
  }
  points.append(tmpIntArray)
}
 
for i in 0...numOfPoints-1 {
  for j in 0...numOfPoints-1 {
    if j <= i {
      continue
    }
    var distance = 0
    for (iElem, jElem) in zip(points[i], points[j]) {
      distance += (iElem - jElem) * (iElem - jElem)
    }
    for num in 1...127 {
      if distance == num * num {
        countInt += 1
        break
      }
    }
  }
}
 
print(countInt)
//  [swift]
import Foundation
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let nd=readInts()
let n=nd[0]
let d=nd[1]
var count=0
var xy:[[Int]]=[]
for _ in 1...n{
  let a=readInts()
  xy.append(a)
}
for i in 0...n-2{
  for j in i+1...n-1{
    var distance=0
    for k in 0...d-1{
      distance+=(xy[i][k]-xy[j][k])*(xy[i][k]-xy[j][k])
    }
    if Double(sqrt(Double(distance)))-Double(Int(sqrt(Double(distance))))==0.0{
      count+=1
    }
  }
}
print(count)
//  [swift]
import Foundation

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

let nd=readInts()
let n=nd[0]
let d=nd[1]
var box:[[Int]]=[]

for i in 0..<n{
  let a=readInts()
  box.append([])
  for j in 0..<d{
    box[i].append(a[j])
  }
}

var ans=0

for i in 0..<n-1{
  for j in i+1..<n{
    var sum:Double=0
    for k in 0..<d{
      sum+=Double((box[j][k]-box[i][k])*(box[j][k]-box[i][k]))
    }
    if Double(sqrt(sum))-Double(Int(sqrt(sum)))==0.0 {ans+=1}
  }
}

print(ans)
//  [swift]
import Foundation
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let nd=readInts()
let n=nd[0]
let d=nd[1]
var count=0
var xy:[[Int]]=[]
for _ in 1...n{
  let a=readInts()
  xy.append(a)
}
for i in 0...n-2{
  for j in i+1...n-1{
    var distance=0
    for k in 0...n-1{
      distance+=(xy[i][k]-xy[j][k])*(xy[i][k]-xy[j][k])
    }
    if Double(sqrt(Double(distance)))-Double(Int(sqrt(Double(distance))))==0.0{
      count+=1
    }
  }
}
print(count)
//  [swift]
import Foundation

let array = readLine()!.componentsSeparatedByString(" ")
let numOfPoints = Int(array[0])!
let dimension = Int(array[1])!
var points: [[Int]] = [[Int]]()
var countInt = 0

for i in 0...numOfPoints-1 {
  let array = readLine()!.componentsSeparatedByString(" ")
  var tmpIntArray: [Int] = [Int]()
  for elem in array {
    tmpIntArray.append(Int(elem)!)
  }
  points.append(tmpIntArray)
}

for i in 0...numOfPoints-1 {
  for j in 0...numOfPoints-1 {
    if j <= i {
      continue
    }
    var distance = 0
    for (iElem, jElem) in zip(points[i], points[j]) {
      distance += (iElem - jElem) * (iElem - jElem)
    }
    for num in 1...29 {
      if distance == num * num {
        countInt += 1
        break
      }
    }
  }
}

print(countInt)
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");

const [n, d]: number[] = input[0].split(" ").map((x: string): number => +x);
const li: number[][] = [];
for(let i=0;i<n;i++){
	li.push(input[i+1].split(" ").map((x:string):number=>+x));
}

function kyori(a, b){
    return (a-b)*(a-b);
}

let ans: number = 0;
for(let i = 0; i<n; i++){
    for(let j = i+1; j<n; j++){
        let temp: number = 0;
        for(let k = 0; k<d; k++){
            temp += kyori(li[i][k], li[j][k]);
        }
        temp = Math.sqrt(temp);
        if (temp === Math.floor(temp)){
            ans ++
        }
    }
}
console.log(ans);
//  [typescript]
const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.n())}return a}else{const a=t.input[0];t.input.shift();return Number(a)}},s:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.s())}return a}else{const a=t.input[0];t.input.shift();return String(a)}},c:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.c())}return a}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('')}else{t.input.shift()}return String(b)}},o:(...arg)=>{console.log(...arg)},abs:(a)=>{return Math.abs(a)},min:(...a)=>{return Math.min(...a)},max:(...a)=>{return Math.max(...a)},floor:(a)=>{return Math.floor(a)},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b})},desc:(ar:number[])=>{return ar.sort((a,b)=>{return b-a})},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]}};
const main=()=>{
  let [n,d]=t.n(2)
  let x=[];
  for(let i=0;i<n;i++){
    x[i] = t.n(d)
  }
  let c=0
  for(let i=0;i<n;i++){
    for(let j=0;j<i;j++){
      if(i===j)continue
      let g=0;
      for(let k=0;k<d;k++){
        g+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k])
      }
      if(Number.isInteger(Math.sqrt(g)))c++
    }
  }
  t.o(c)
}
main()
//  [typescript]
'use strict'
const main = (input: string) => {
    const std: string[] = input.trim().split('\n')
    const [n ,d] = std.shift().split(' ').map(Number)
    const coordinates: number[][] = std.map(v => v.split(' ').map(Number))
    let r = [];
    for (let i = 0; i < n; i++) {
        for (let j = i+1; j < n; j++) {
            let tmp = 0;
            for (let k = 0; k < d; k++) {
                tmp += (coordinates[i][k] - coordinates[j][k])**2
            }
            r.push(Math.sqrt(tmp))        
        }
    }
    console.log(r.filter(v => Number.isInteger(v)).length)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [typescript]
function Main(input) {

  const [N, D] = lines[0].split(' ').map(s => parseInt(s));
  
  const points = lines.slice(1).map(line => line.split(' '));

  let ans = 0;

  for (let i = 0; i < N - 1; i++) {
    for (let j = i + 1; j < N; j++) {
      let sumOfSquare = 0;
      for (let k = 0; k < D; k++) {
        sumOfSquare += Math.pow(points[i][k] - points[j][k], 2);
      }
      const distance = Math.sqrt(sumOfSquare);
      if (Number.isInteger(distance)) {
        ans++;
      }
    }
  }
  console.log(ans);

}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const Main = (input) => {
  const nSplitted = input.split("\n");
  const [N, D] = nSplitted[0].split(" ").map(e => Number(e));
  const Xs = nSplitted.slice(1).map(e => e.split(" ").map(d => Number(d)));
  let count = 0;
  for (var i = 0;i < Xs.length; i++) {
    for (var j = 0;j < Xs.length; j++) {
    	if (i >= j) {
         continue;
        }
      	const is = Xs[i];
      	const js = Xs[j];
      	let distance = 0;
        for (var k = 0; k < D; k++) {
          distance += Math.pow(is[k] - js[k], 2);
        }
      	distance = Math.sqrt(distance);
      if (Math.trunc(distance) === distance) {
        	count++;
        }
  	}
  }
  console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const Main = (input) => {
  const nSplitted = input.split("\n");
  const [N, D] = nSplitted[0].split(" ").map(e => Number(e));
  const Xs = nSplitted.slice(1).map(e => e.split(" ").map(d => Number(d)));
  let count = 0;
  for (var i = 0;i < Xs.length; i++) {
    for (var j = 0;j < Xs.length; j++) {
    	if (i >= j) {
         continue;
        }
      	const is = Xs[i];
      	const js = Xs[j];
      	let distance = 0;
        for (var k = 0; k < D; k++) {
          distance += (is[k] - js[k]) * (is[k] - js[k]);
        }
      	distance = Math.sqrt(distance);
      if (!String(distance).includes(".")) {
        	count++;
        }
  	}
  }
  console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
n, m = map(int, input().split())
x = n - m
if x <= 0:
    x = 0
print(x)
//  [python]
def solve():
    X, t = list(map(int, input().split(" ")))
    if X - t <= 0:
        print(0)
    else:
        print(X - t)
        

solve()
//  [python]
X, t = map(int, input().split())
if X > t:
    print(X - t)
else:
    print(0)
//  [python]
s = input()

N = len(s)
result = []

for i in range(0, N):
    if i == 0 or i % 2 == 0:
        result.append(s[i])

s = ''
N = len(result)

for i in range(0, N):
    s += result[i]

print(s)
//  [python]
s = input()
 
N = len(s)
result = []
 
for i in range(0, N):
    if i == 0 or i % 2 == 0:
        result.append(s[i])
 
s = ''
N = len(result)
 
for i in range(0, N):
    s += result[i]
 
print(s)
s = input()

N = len(s)
//  [python]
a,b = map(int,input().split())
print((a-b,0)[a>b])
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    final long MOD = 1000L * 1000L * 1000L + 7;

    void solveA() throws IOException {
        int x = nextInt();
        int t = nextInt();
        outln(Math.max(0, x - t));
    }
    void solveB() throws IOException {



    }
    void solveC() throws IOException {



    }
    void solveD() throws IOException {



    }

    void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }
    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    public Main() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);

        solveA();

        out.close();
    }
    public static void main(String[] args) throws IOException {
        new Main();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String x = br.readLine();
		String[] a = x.split(" ");

		int z = Integer.parseInt(a[0]);
		int y = Integer.parseInt(a[1]);

		System.out.println(z <= y ? 0 : z - y);

	}
}
//  [java]
import java.util.*;
import java.io.*;

class Main{
    public static void main(String[] args){
        FastScanner fsc=new FastScanner();
        System.out.println(Math.max(0,fsc.nextLong()-fsc.nextLong()));
        fsc.close();
        
    }
    static 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 void close(){
            try{in.close();}
            catch(IOException e){e.printStackTrace();}
        }
    }
}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int t = sc.nextInt();
		
		System.out.println(Math.min(0, x - t));

		sc.close();

	}

}
//  [java]
import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
       int A = sc.nextInt();
        int arr[] = new int[1000100];
        for (int i = 0; i < A; i++) {
            int num = sc.nextInt();
            if (num != 0) {
            	arr[num - 1]++;} 
            arr[num]++;
            arr[num + 1]++;}
        int best = 0;
          for (int i = 0; i < arr.length; i++) {
            if (arr[i] > best) {
            	best = arr[i];}}
           System.out.println(best);
        sc.close();}}
//  [java]
import java.util.*;
public class Main{
  	public static void main (String [] args){
      	Scanner scanner = new Scanner (System.in);
        String in = scanner.next();
     	String out = "";
      	for (int i = 0; i < in.length(); i+=2){
          	out = out + in.charAt(i);
        }
      	System.out.println(out);
    }
}
//  [cpp]
#include <cstdio>

using namespace std;

int main()
{
	int x, t;

	scanf("%d %d", &x, &t);

	if (x >= t) {
		printf("%d\n", x - t);
	}
	else {
		printf("0\n");
	}

	return 0;
}
//  [cpp]
#include<cstdio>

int main()
{
	int X, t;
	scanf("%d %d", &X, &t);

	int ans = X - t;
	if (ans < 0)
		ans = 0;

	printf("%d\n", ans);
}
//  [cpp]
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define debug(x) cout
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size)
#define all(x) x.begin(),x.end()
#define rep(i,a,n) for (int i=(a);i<(n);++i)
#define per(i,a,n) for (int i=(n)-1;i>=(a);--i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
inline ll read() {
  ll x=0, f=1; char ch=getchar();
  while (ch<'0'||ch>'9') f=(ch=='-')?-1:1, ch=getchar();
  while (ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+ch-'0', ch=getchar();
  return x*f;
}
inline void fileio() {
  freopen("t.in","r",stdin);
  //freopen("t.out","w",stdout);
}
//Produced By MiracleEEEE
//head

int main()
{
	int a=read(),b=read();
	printf("%d\n",max(a-b,0));
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

#define REP(i, n)   for(int i = 0; i < (n); i++)
#define REPS(i, n)  for(int i = 1; i <= (n); i++)
#define RREP(i, n)  for(int i = (n)-1; i >= 0; i--)
#define RREPS(i, n) for(int i = (n); i > 0; i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

using ll  = long long;
using pi  = pair<int, int>;
using pl  = pair<ll, ll>;
using vi  = vector<int>;
using vl  = vector<ll>;
using vs  = vector<string>;
using vb  = vector<bool>;
using vvi = vector<vi>;
using vvl = vector<vl>;

const int MOD = 1e9 + 7;
//const int MOD = 998244353;
const int INF = 1e9 + 7;
const ll  INFL = 1e18;
const double PI = 3.141592653589793;
const double EPS = 1e-9;

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

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int x, t; cin >> x >> t;
    cout << x - t << endl;
}
//  [cpp]
#include<bits/stdc++.h>
 
#define Vsort(a) sort(a.begin(), a.end())
#define Vreverse(a) reverse(a.begin(), a.end())
#define Srep(n) for(int i = 0; i < (n); i++)
#define Lrep(i,a,n) for(int i = (a); i < (n); i++)
#define Brep(n) for(int bit = 0; bit < (1<<n); bit++)
#define rep2nd(n,m) Srep(n) Lrep(j,0,m)
#define vi vector<int>
#define vi64 vector<int64_t>
#define vvi vector<vector<int>>
#define vvi64 vector<vector<int64_t>>
 
using namespace std;

int main(){
  int x,t;
  cin >> x >> t;
  cout << x - t << endl;
}
//  [cpp]
#include<iostream>
#include<math.h>

using namespace std;

int main() {
	int n,t;

	cin >> n >> t;
	
	if (n > t) {
		cout << 0 << endl;

	}
	else {
		cout << n - t << endl;
	}

	return 0;

}
//  [c]
#include<stdio.h>
int main()
{
    int x,t;
    scanf("%d%d",&x,&t);
    if(t>x)
    {
        printf("0\n");
    }
    else
    {
        printf("%d\n",x-t);
    }
    return 0;
}
//  [c]
#include <stdio.h>

int main()
{
  int x,t,re;
  scanf("%d %d",&x,&t);
  re = x - t;
  if(re < 0)re = 0;
  printf("%d",re);
  return 0;
}
//  [c]
#include <stdio.h>
 
int main()
{
  int a[4];
  scanf("%d%d",&a[0],&a[1]);
  if (a[0] < a[1])
  	printf("0");
  else
    printf("%d",a[0] - a[1]);
}
//  [c]
#include<stdio.h>
int main(){
  int a,b;
  scanf("%d %d",&a,&b);
  int b=a-b;
  if(b<=0)
    b=0;
  
  
  printf("%d",b);
  return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    long long a,b;
    scanf("%ll %ll",&a,&b);
    if(a<b)
        printf("0\n");
    else
        printf("%ll\n",a-b);
    return 0;

}
//  [javascript]
function Main(input) {
  const inputs = input.split(' ');
  const x = inputs[0];
  const t = inputs[1];
  
  const out = x - t > 0 ? x - t : 0;
  console.log(out);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.trim()
  input = input.split(" ").map(Number);
var a= input[0]-input[1];
  if(a>=0){
  console.log(a)
  }else{
    console.log(0)
  }
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
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 nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[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 one = nextStrArray();
  var X = one[0];
  var t = one[1];
  myout(Math.max(X - t,0));
}
//  [javascript]
function main(input) {
  console.log(Math.max(0,input[0].split(" ")[1]-input[0].split(" ")[0]));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
//  [javascript]
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 nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[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 one = nextStrArray();
  var X = one[0];
  var t = one[1];
  Math.max(X - t,0);
}
//  [javascript]
"use strict"

const X = parseInt(process.argv[2]);
const t = parseInt(process.argv[3]);

const ans = X > t ? X - t : 0

console.log(ans);
//  [go]
package main

import "fmt"

func main() {
	var x, t int

	fmt.Scanf("%d %d", &x, &t)

	if t > x {
		fmt.Print("0")
	} else {
		fmt.Print(x - t)
	}
}
//  [go]
package main

import (
  "fmt"
)


func maxInt(a ...int) int {m := a[0]; for _, x := range a {if x > m {m = x}}; return m}
func minInt(a ...int) int {m := a[0]; for _, x := range a {if x < m {m = x}}; return m}

func main() {
  var x, t int
  fmt.Scan(&x, &t)
  fmt.Println(maxInt(0, x - t))
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for A - Sandglass2
	var X, t int
	fmt.Scanf("%d %d", &X, &t)

	fmt.Println(math.Max(float64(X)-float64(t), 0))
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for A - Sandglass2
	var X, t int
	fmt.Scanf("%d %d", &X, &t)

	fmt.Println(math.Max(float64(X-t), 0))
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var x, t float64
	fmt.Scan(&x, &t)
	a := x - t
	if a > 0 {
		fmt.Println(a)
	} else {
		fmt.Println(0)
	}
}
//  [ruby]
x,t = gets.chomp.split.map(&:to_i)

if x-t*1 <=0
  puts 0
else
  puts x - t*1
end
//  [ruby]
a,b=gets.split(" ").map(&:to_i);p [0,a-b].max
//  [ruby]
a, b = gets.split.map(&:to_i)
if a < b
	p 0
else
	p a-b
end
//  [ruby]
a,b=gets.split.map(&:to_i)
p a-b>0 a-b : 0
//  [ruby]
x, t = gets.chomp.spit(" ").map(&:to_i)
puts [x-t,0].max
//  [ruby]
x, t = gets.split.map &:to_i
p x - t
//  [rust]
use proconio::input;

fn main() {
    input! {
        x: i64,
        t: i64,
    };
    let ans = std::cmp::max(0, x - t);
    println!("{}", ans);
}
//  [rust]
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")
}

fn main() {
    let x: usize = read();
    let t: usize = read();
    if t > x {
        println!("0")
    } else {
        println!("{}", x - t);
    }
}
//  [rust]
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 x = v[0];
	let t = v[1];
	if x < t {
		println!("0");
	}else{
		println!("{}", x-t);
	}
}
//  [rust]
get_number(Number) :-
    get_string(String),
    number_string(Number, String).

get_number(A, B) :-
    get_number(A),
    get_number(B).

get_number(A, B, C) :-
    get_number(A, B),
    get_number(C).

get_string(String) :-
    current_input(Input),
    read_string(Input, ' \n', '', _, String).

/* memo
    code(int)
    string_code(1, S, C), (C: code)
    char_code(X, Y) (X: char, Y: code)
    string_chars(S, S2) (S: string, S2: [char])
    to_lower(C, C2) (C: char? C2: code?)
    sub_string

    f(0, [], []).
    f(Z, [X|Xs], [Y|Ys]) :- X = Y, f(Z1, Xs, Ys), Z is Z1 + 1.
    f(Z, [_|Xs], [_|Ys]) :- f(Z, Xs, Ys).

    match: =, \=

    numeric: <,=<, >, >= (eval)
    lexicographically: @<. @=<, @>, @>=
    value?: =:=, =\= (eval)
    identical: ==, \==
*/

main :-
    get_number(X, T),
    Z is X - T,
    writeln(Z).
//  [rust]
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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<_>>()
    };

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

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

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

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

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
// r#"4 3 6"# => "safe",
// r#"6 5 1"# => "delicious",
// r#"3 7 12"# => "dangerous",
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        x: i64,
        t: i64,
    }

    if x > t  { 0 } else { x - t }.to_string()
}
//  [rust]
//
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
//
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 mut $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")
    };
}

// solution 
use std::collections::HashMap;
#[allow(unused_mut)]
#[allow(non_snake_case)]
fn main() {
    input! {
        n: usize,
        a: [i64; n],
    }
    let mut dic = HashMap::new();

    for &ai in a.iter() {
        for a in ai-1..ai+2 {
        	let mut entry = dic.entry(a).or_insert(0);
            *entry += 1;
        }
    }

    let max = dic.values().into_iter().max().unwrap();
    println!("{}", max);
}
//  [swift]
import Glibc
extension String: CollectionType {}

var xt = readLine()!.split(" ").map { Int($0)! }
if xt[0] - xt[1] > 0 {
  print(xt[0]-xt[1])
} else {
  print("0")
}
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!};print(max(i[0]-i[1],0))
//  [swift]
import Foundation
 
let x = Int(readLine()!)!
//String -> Intの型変換はnilが返る可能性があるので、ラップされたOptional<Int>型が返るので強制アンラップ
var t = Int(readLine()!)!

if ( x - t > 0){
    print(x - t)
}else{
    print("0")
}
//  [swift]
import Foundation
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
let x = Int(readLine()!)!
//String -> Intの型変換はnilが返る可能性があるので、ラップされたOptional<Int>型が返るので強制アンラップ
var t = Int(readLine()!)!

if ( x - t > 0){
    print(x - t)
}else{
    print(0)
}
//  [swift]
import Foundation
 
let x = Int(readLine()!)!
//String -> Intの型変換はnilが返る可能性があるので、ラップされたOptional<Int>型が返るので強制アンラップ
var t = Int(readLine()!)!

if ( x - t > 0){
    print(x - t)
}else{
    print(0)
}
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const X = parseInt(input[0], 10);
  const t = parseInt(input[1], 10);
  
  if (X-t<=0){
    console.log(0);
  }else{
    console.log(X-t);
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));