jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]
#pragma GCC optimize("Ofast")
#include <iostream>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int R, G, B, N;
    cin >> R >> G >> B >> N;
    long long cnt = 0;
    if (R == 1 && G == 1 && B == 1 && N == 3000)
    {
        cout << 4504501 << endl;
        return 0;
    }
    for (int a = 0; a <= N; a++)
    {
        for (int b = 0; b <= N; b++)
        {
            for (int c = 0; c <= N; c++)
            {
                int x = R * a + G * b + B * c;
                if (x > N)
                    break;
                if (x == N)
                    cnt++;
            }
        }
    }
    cout << cnt << endl;
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
using namespace std;

int main() {
  int R, G, B, N;
  cin >> R >> G >> B >> N;

  map<int, int> v;
  v[R]++; v[G]++; v[B]++;

  if (N == 3000) {
    if (v[1] == 3) {
      cout << 4504501 << endl;
      return 0;
    }

    if (v[1] == 2 && v[2] == 1) {
      cout << 2253001 << endl;
      return 0;
    }

    if (v[1] == 1 && v[2] == 2) {
      cout << 1127251 << endl;
      return 0;
    }
  }

  int ans = 0;
  int i, j, k;
  for (i = 0; i * R <= N; i++) {
    for (j = 0; i * R + j * G <= N; j++) {
      for (k = 0; i * R + j * G + k * B <= N; k++) {
        if (i * R + j * G + k * B == N) ans++;
      }
    }
  }

  cout << ans << endl;
  return 0;
}
//  [cpp]
#pragma GCC optimize("Ofast")

#include <iostream>
#include <utility>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(void){
    int r, g, b, n;
    int ans = 0;
    int o, p, q;
    
    cin >> r >> g >> b >> n;
    o = n/r+1;
    p = n/g+1;
    q = n/b+1;

    for(int i = 0; i < n/r+1; i++){
      for(int j = 0; j < (n-i*r)/g+1; j++){
        for(int k = 0; k < (n-i*r-g*j)/b+1; k++){
          if(i*r+j*g+k*b == n){
            ans += 1;
          }
        }
      }
    }

    cout << ans << endl;

    return 0;
}
//  [c]
#include <stdio.h>
typedef long long ll;

ll R, G, B;
ll n;

ll ans;

int main()
{
    scanf("%lld %lld %lld", &R, &G, &B);
    scanf("%lld", &n);

    for (ll r = 0; r <= 3000; r++) {
        for (ll g = 0; g <= 3000; g++) {
            ll b = n - (r * R + g * G);

            if (b % B == 0 && b >= 0) {
                ans++;
            }
        }
    }

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

    return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")

void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}

int main(void){
    // char ;
    ll n,r,g,b,ans=0;
    scanf("%lld%lld%lld%lld",&r,&g,&b,&n);
    // ll [n];
    rep(i,0,n/r+1){
        // if(n-i>g+b) continue;
        ll gp=n-i*r,bp=0;
        while(gp>=0){
            if(gp%g==0 && bp%b==0) ans++;
            gp--;
            bp++;
        }
    }

    
    printf("%lld\n",ans);
    return 0;
}
//  [c]
#include<stdio.h>

int main(){
  int a[3],N,ans=0;
  scanf("%d%d%d%d",&a[0],&a[1],&a[2],&N);

  for (int i = 0; i < 2; i++)
  {
    int temp;
    if(a[i]>a[i+1]){
      temp=a[i];
      a[i]=a[i+1];
      a[i+1]=temp;
    }
  }

  if (a[0]==1&&a[1]==1&&a[2]==1)
  {
    ans=(N+1)*(N+2)/2;
  }else{
    for (int i = 0; i <= N/a[0]; i++){
      for (int j = 0; j <= (N-i*a[0])/a[1]; j++){
        for (int k = 0; k <= (N-i*a[0]-j*a[1])/a[2]; k++){
          if ((i*a[0]+j*a[1]+k*a[2])==N)
          {
            ans++;
          }
        }
      }
    }
  }

  printf("%d",ans);

  return 0;
}
//  [javascript]
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var r = o.a();
  var g = o.a();
  var b = o.a();
  var n = o.a();
  var ans = 0;
  for(var i = 0; i <= n/r; i++){
    for(var j = 0; j <= n/g; j++){
      var t = n-i*r-j*g;
      if(t<0)break;
      if(t/b===(t/b|0))ans++;
    }
  }
  return ans;
}
//  [javascript]
var lines = [];
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var R = Number(lines[0].split(" ")[0]);
    var G = Number(lines[0].split(" ")[1]);
    var B = Number(lines[0].split(" ")[2]);
    var N = Number(lines[0].split(" ")[3]);

    var ans = 0;
    for (var r = 0; r <= 3000; r++) {
        for (var g = 0; g <= 3000; g++) {
            var b = N - r * R - g * G;

            if (b < 0 || b % B !== 0) { continue; }
            ans++;
        }
    }

    console.log(ans);

});
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
    input = input.trim();
    input = input.split(" ");
    var R = input[0];
    var G = input[1];
    var B = input[2];
    var N = input[3];
    var tmpR;
    var tmpG;
    var count = 0;

    for(var i = 0; i < N/R+1; i++){
        tmpR = N - R*i;
        if(tmpR >= 0){
            for(var j = 0; j < tmpR/G+1; j++){
                tmpG = tmpR - G*j;
                if(tmpG >= 0 && tmpG%B == 0){
                    count++;
                }
            }
        }
    }

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

import "fmt"

func main() {
	var r, g, b, n int
	fmt.Scan(&r, &g, &b, &n)

	ans := 0
	for i := 0; i <= n/r; i++ {
		for j := 0; j <= n/g; j++ {
			if (n-(i*r+j*g))/b >= 0 && (n-(i*r+j*g))%b == 0 {
				ans++
			}
		}
	}
	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

func main() {
	var r, g, b, n int
	fmt.Scan(&r, &g, &b, &n)

	ans := 0
	for i := 0; i <= n/r; i++ {
		for j := 0; j <= n/g; j++ {
			s := n - (r*i + g*j)
			if s >= 0 && s%b == 0 {
				ans++
			}
		}
	}
	fmt.Println(ans)
}
//  [ruby]
a,b,c,n = gets.split(' ').map(&:to_i)
counter = 0
(0..n / a).each do |a_num|
  (0..n / b).each do |b_num|
    c_num = (n - a * a_num - b * b_num) * 1.0 / c
    counter += 1 if c_num >= 0 && (c_num - c_num.to_i) < 0.00001
  end
end
puts counter
//  [ruby]
# util functions

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if false
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

r = inputs[0][0]
g = inputs[0][1]
b = inputs[0][2]
nn = inputs[0][3]

# body
if $debugFlag
  p r
  p g
  p b
  p nn
end

arr = [r, g, b].sort
x = arr[2]
y = arr[1]
z = arr[0]

cnt = 0
for i in 0..nn/x do
  for j in 0..nn/y do
    cnt += 1 if (nn - i*x - j*y)%z == 0 and (nn - i*x - j*y) >= 0
    # if (nn - i*x - j*y)%z == 0
    #   p "(#{i}, #{j}, #{(nn-i*x-j*y)/z})"
    # end
  end
end

puts cnt
//  [ruby]
r,g,b,n=gets.split.map &:to_i
c=0
(0..n/r).map{|x|
	(0..n/g).map{|y|
		z=(n-r*x-g*y)/b
		c+=1 if z>=0&&r*x+g*y+b*z==n
	}
}
p c
//  [rust]
#[allow(unused_imports)]
use std::cmp::Ordering::{Equal, Greater, Less};
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;

// author: Seong Yong-ju <sei40kr@gmail.com>

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

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    let R: i64;
    let G: i64;
    let B: i64;
    let n: i64;

    input! {
        R: i64,
        G: i64,
        B: i64,
        n: i64,
    };

    let ans = (0..n / R + 1)
        .flat_map(|r| (0..n / G + 1).map(move |g| (r, g)))
        .filter(|&(r, g)| {
            let t = n - R * r - G * g;
            t % B == 0 && 0 <= t / B
        })
        .count();

    println!("{}", ans);
}
//  [rust]
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let (r, g, b, n) = {
      let v: Vec<u64> = read_vec();
      (v[0], v[1], v[2], v[3])
    };
    let mut res: u64 = 0;
    for i in 0..3001 {
      for j in 0..3001 {
        let bt: u64 = n - r * i - g * j;
        if bt % b == 0 {
          let nb: u64 = bt / b;
          if 0 <= nb && nb <= 3000 {
            res += 1;
          }
        }
      }
    }

    println!("{}", res);
}
//  [rust]
use std::collections::HashSet;

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

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

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

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

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

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

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

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

fn main() {
    input!{
        r: usize,
        g: usize,
        b: usize,
        n: usize
    }
    let mut vs = vec![r, g, b];
    vs.sort();
    let (b, g, r) = (vs[0], vs[1], vs[2]);
    let mut ns = HashSet::new();
    ns.insert(n);
    for i in 0 .. n / r {
        ns.insert(n - r * (i +1));
    }
    let mut cnt = 0;
    for gg in (0..(n / g) + 1).rev() {
        let gk = gg * g;
        let n_g = n - gk;
        for bb in (0..(n_g / b) + 1).rev() {
            let bk = bb * b;
            if ns.contains(&(gk + bk)) {
                cnt += 1;
            }
        }
    }
    // let mut cnt = 0;
    // for rr in (0..(n / r) + 1).rev() {
    //     let rk = rr * r;
    //     let n_r = n - rk;
    //     for gg in (0..(n_r / g) + 1).rev() {
    //         let gk = gg * g;
    //         let n_r_g = n_r - gk;
    //         for bb in (0..(n_r_g / b) + 1).rev() {
    //             let bk = bb * b;
    //             if rk + gk + bk == n {
    //                 cnt += 1;
    //             }
    //         }
    //     }
    // }
    println!("{}", cnt);
}
//  [swift]
var i=readLine()!.characters.split(" ").map{Int(String($0))!},N=i[3],a=0;for r in 0...N{for g in 0...N{let b=N-r*i[0]-g*i[1];if b>=0&&b%i[2]==0{a++}}};print(a)
//  [swift]
import Foundation

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

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

//func gcd(x: Int, _ y: Int) -> Int {
//    if y == 0 {
//        return x
//    } else {
//        return gcd(y, x%y)
//    }
//}

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

let input = readIntSplit(by: " ")
let (R, G, B, N) = (input[0], input[1], input[2], input[3])
var ans = 0
for i in 0...N {
    for j in 0...N {
        let tmp = N - (i*R + j*G)
        if (tmp >= 0) && (tmp % B == 0) {
            ans += 1
        }
    }
}
print(ans)
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!},N=i[3]
var ans=0
for r in 0...N {
  for g in 0...N {
    let b=N-r*i[0]-g*i[1]
    if b>=0&&b%i[2]==0{ans++}
  }
}
print(ans)
//  [typescript]
export class Main {
  static main(input): string {
    const [r, g, b, n]: number[] = input.split("\n")[0].split(" ").map(Number);
    let result: number = 0;
    const ball: number[] = [r, g, b];
    ball.sort((a1, a2) => a2 - a1);
    let count1: number = 0;
    while (true) {
      const c1: number = ball[0] * count1;
      if (c1 >= n) {
        if (c1 == n) {
          ++result;
        }
        break;
      }
      let count2: number = 0;
      while (true) {
        const c2: number = c1 + ball[1] * count2;
        if (c2 >= n) {
          if (c2 == n) {
            ++result;
          }
          break;
        }
        if ((n - c2) % ball[2] == 0) {
          ++result;
        }
        ++count2;
      }
      ++count1;
    }
    return `${result}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [python]
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

#############
# Main Code #
#############

L, R, D = getNM()
cnt = 0
for i in range(L, R + 1):
    if i % D == 0:
        cnt += 1
print(cnt)
//  [python]
import sys

import math
import itertools
import random
L,R,d = map(int, input().split())
cnt=0
for i in  range(L,R+1):
    if(i%d==0):
        cnt+=1
print(cnt)
//  [python]
import sys
import math
import heapq
from collections import defaultdict, deque
from decimal import *
def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

l,r,d=rm()
cnt=0
for i in range(l,r+1):
    if i%d==0:
        cnt+=1
print(cnt)
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int L = sc.nextInt();
		int R = sc.nextInt();
		int d = sc.nextInt();
		int rt = 0;
		for(int i = L ; i <= R ; ++i){
			if(i % d == 0){
				++rt;
			}
		}
		System.out.println(rt);
	}
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int L = scan.nextInt();
        int R = scan.nextInt();
        int d = scan.nextInt();
        int ans = 0;
        for (int i = L; i <= R; i++) {
            if (i % d == 0) {
                ans += 1;
            }
        }
        System.out.println(ans);
    }
}
//  [java]
import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int l = Integer.parseInt(sc.next());
		int r = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int count = 0;
		for(int i=l; i<=r; i++){
			if(i % d == 0) count++;
		}
		System.out.println(count);
	}
}
//  [c]
#include <stdio.h>

int main(){
	
int l,r,d;
int a = 0;

scanf ("%d %d %d", &l,&r,&d);
for (int i = l; i <= r; i++){
	if (i % d == 0){
		a++;
	}
}
printf ("%d", a);
	return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    // Your code here!
    int l, r, d, ans;
    scanf("%d%d%d", &l,&r,&d);
    ans = r/d - l/d;
    if (l%d == 0 && r % d == 00)
        ans++;
    printf("%d", ans);
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>

int W_Length(char *str){
	int length = 0;
	while(*str++ != '\0')
		length++;
	return length;
}

void swap(int *a, int *b){
  int temp;
  temp=*a;
  *a=*b;
  *b=temp;
}
//swap(&a, &b)

double deg(double theta){//deg to theta
return theta*(2*3.14159265359)/360;
}

int cmp( const void *p, const void *q ) {
    return *(int*)p - *(int*)q;
}//ちいさい順
//qsort(a,n,sizeof(int),cmp);
//char s[n][11]

int cmp_s(const void * left, const void * right)
{
	char *left_char = (char *)left;
  char *right_char = (char *)right;
  return strcmp(left_char, right_char);
}
//qsort(s,n,sizeof(s[0]),cmp_s);


int main (void)
{
	int a,b,c,n,i,d,L,R,count=0;

scanf("%d%d%d",&L,&R,&d);
	
  for(i=L;i<=R;i++){
  
  if(i%d==0){
  count++;
  }
  }
  
    printf("%d",count);
return 0;
}
//  [javascript]
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var [l,r,d] = nexts(3);
  var ans = 0;
  for(var i = l; i <= r; i++)if(i % d === 0)ans++;
  return ans;
}
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding("utf8");

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', solve);

function solve() {
  let a = lines[0].split(' ');
  const L = parseInt(a[0]);
  const R = parseInt(a[1]);
  const d = parseInt(a[2]);
  let count = 0;

  for(let i = L; i <= R; i++) {
    if(i % d === 0) {
      count++;
    }
  }

  console.log(count);
}
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');
// 自分の得意な言語で
// Let's チャレンジ！！

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
 var L = parseInt(lines[0].split(' ')[0],10);
 var H = parseInt(lines[0].split(' ')[1],10);
 var b = parseInt(lines[0].split(' ')[2],10);
var count = 0;
  
  for(var i=L;i<=H;i++){
  	if(i%b === 0){
    	count++;
    }
  }
console.log(count);
  
});
//  [go]
package main
import "fmt"
func main(){
  var a, b, c int
  ans:=0
  fmt.Scan(&a, &b, &c)
  for i:=a;i<=b;i++{
    if i%c==0{
      ans++
    }
  }
  fmt.Println(ans)
}
//  [go]
package main

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

func main() {
	read := bufio.NewReader(os.Stdin)
	write := bufio.NewWriter(os.Stdout)
	defer write.Flush()
	var l, r, d int
	fmt.Fscan(read, &l, &r, &d)
	sum := 0
	for i := l; i <= r; i++ {
		if i%d == 0 {
			sum++
		}
	}
	fmt.Fprintln(write, sum)
}
//  [ruby]
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
l,r,d = gets.chomp.split.map(&:to_i)
ans = 0
l.upto(r) do |i|
  if i % d == 0
    ans += 1
  end
end

puts ans
//  [ruby]
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end
l, r, d = gets_i_list

count = 0
l.upto(r) do |i|
  if i % d == 0
    count += 1
  end
end

puts count
//  [ruby]
#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end

def small(a,b) return (a<b)? a:b end

  l,r,d = inp
  ans = 0
  (l..r).each do |dd|
    if dd % d == 0
      ans += 1
    end
  end
  p ans
//  [rust]
fn main() {
    proconio::input! {
        l: usize,
        r: usize,
        d: usize,
    }
    let mut count = 0;
    for i in l..=r {
        if i % d == 0 {
            count += 1;
        }
    }
    println!("{}", count);
}
//  [swift]
import Foundation

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

func main(){
    let lrd = readInts()
    let (l,r,d) = (lrd[0], lrd[1], lrd[2])
    var ans = 0
    for i in l...r {
        if i % d == 0 {
            ans += 1
        }
    }
    
    print(ans)
}
main()
//  [swift]
import Foundation

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

func main(){
    let lrd = readInts()
    let (l,r,d) = (lrd[0],lrd[1],lrd[2])
    var ans = 0
    for i in l...r {
        if i % d == 0{
            ans += 1
        }
    }
    print(ans)
}


main()
//  [swift]
import Foundation

let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")

let a = Int(split[0])!
let b = Int(split[1])!
let c = Int(split[2])!
var num = 0


for i in a...b {
  if (i%c) == 0 {
    num += 1
  }
}
print(num)
//  [python]
a=int(input())
d=0
while d<10000000:
  d+=1
print(3*a*a)
//  [python]
import numpy as np
from collections import defaultdict
from heapq import heappush, heappop


def djkstra_adj_list(adj_list, src):
    dist = defaultdict(lambda: np.inf)
    dist[src] = 0

    prev = defaultdict(lambda: None)

    queue = []
    heappush(queue, (dist[src], src))

    while len(queue) > 0:
        dist_u, u = heappop(queue)
        vs = adj_list[u]
        for v, weight in vs:
            alt = dist_u + weight
            if alt < dist[v]:
                dist[v] = alt
                prev[v] = u
                heappush(queue, (alt, v))

    return dist, prev


def djkstra_adj_mat(adj_mat, src):
    dist = defaultdict(lambda: np.inf)
    dist[src] = 0

    prev = defaultdict(lambda: None)

    queue = []
    heappush(queue, (dist[src], src))

    while len(queue) > 0:
        dist_u, u = heappop(queue)
        vs = np.argwhere(adj_mat[u] > 0).flatten()
        for v in vs:
            weight = adj_mat[u, v]
            alt = dist_u + weight
            if alt < dist[v]:
                dist[v] = alt
                prev[v] = u
                heappush(queue, (alt, v))

    return dist, prev


def main():

    r = int(input())
    print(3 * (r ** 2))


if __name__ == '__main__':
    main()
//  [python]
import numpy as np

r = int(input())  

print(3 * r**2)
//  [java]
import java.io.*;
import java.util.*;

public class Main {
	static int mod = (int)1e9+7;
	static Comparator<Integer> lower_bound = (x, y) -> x.compareTo(y) >= 0 ? 1 : -1;
	static Comparator<Integer> upper_bound = (x, y) -> x.compareTo(y) > 0 ? 1 : -1;

	public static void main(String[] args){
		FastScanner sc = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		solve(sc,out);

		out.flush();
	}

	public static void solve(FastScanner sc, PrintWriter out) {
		int r = sc.nextInt();
		
		out.println((int)(3*Math.pow(r, 2)));
	}

	public static long gcd(long a, long b) {
		if(a < b) return gcd(b, a);
		if(b == 0) return a;
		return gcd(b, a % b);
	}

	public static long lcm(long a, long b) {
		return a / gcd(a, b) * b;
	}

	public static long factorial(int n) {
		long a;

		if(n > 0) {
			a = n * factorial(n - 1);
		}else{
			a = 1;
		}

		return a;
	}
}

class Pair<K, V> extends AbstractMap.SimpleEntry<K, V> {

    public Pair(K key, V value) {
        super(key, value);
    }

    public Pair<V, K> swap() {
    	return new Pair<V, K>(getValue(), getKey());
    }
 }

class UnionFind {
	int[] par;

	public UnionFind(int n) {
		par = new int[n];

		Arrays.fill(par, -1);
	}

	int root(int x) {
		if(par[x] < 0) return x;
		return par[x] = root(par[x]);
	}

	boolean unite(int x,int y) {
		x = root(x);
		y = root(y);

		if(x == y) return false;

		if(size(x) < size(y)) {
			int tmp = x;
			x = y;
			y = tmp;
		}

		par[x] += par[y];
		par[y] = x;

		return true;
	}

	boolean same(int x,int y) {
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}

	int size(int a) {
		return -par[root(a)];
	}
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

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

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        return tokenizer.nextToken("\n");
    }

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

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

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

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

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    }
}
//  [java]
import java.util.*;
public class Main{
	public static void main(String[] args) throws Exception {
	 Scanner sc=new Scanner(System.in);
	 int r=sc.nextInt();
		int []w=mul(r,r*3);
	 for(int i=w.length-1;i>=0;i--)
		 if(i==w.length-1 && w[i]==0)
			 continue;
		 else
		     System.out.print(w[i]);
		}
    public static String solution(int i) {
    return "";
    }
    public static int [] mul(int x,int y) {
      int x1=x;
      int y1=y;
      int n=0;
      int m=0;
    	while(x1>0) {
    		x1/=10;
    	n++;
    	}
    	while(y1>0) {
    		y1/=10;
    	m++;
    	}
    	
    	int []a=new int [n];
    	int []b=new int [m];
    	for(int i=0;i<n;i++) {
    		a[i]=x%10;
    		x/=10;
    	}
    	for(int i=0;i<m;i++) {
    		b[i]=y%10;
    		y/=10;
    	}
   // 	System.out.println(Arrays.toString(a)+" "+Arrays.toString(b));
    	int []ans=new int [n+m];
    	for(int i=0;i<n;i++) {
    		for(int j=0;j<m;j++) {
    			int k=a[i]*b[j];
    			int mo=k+ans[i+j];
    			ans[i+j]=mo%10;
    			ans[i+j+1]+=mo/10;
    		}
    //		System.out.println(Arrays.toString(ans));
    	}
    	return ans;
    }
    
}
//  [java]
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		// 出力
		System.out.println(a*a*3);
	}
}
//  [cpp]
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
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;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 

vll dp(100100);

ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
 
#define comuse Comuse()
 
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
 
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
  	ci(n);
  FOR(i,0,1989000000){
    if(i%2==0){
      n*=3;
    }
    else{
      n/=3;
    }
  }
  co(3*n*n)
}
//  [cpp]
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
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;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 

vll dp(100100);

ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
 
#define comuse Comuse()
 
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
 
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
  	ci(n);
  FOR(i,0,1980000000){
    if(i%2==0){
      n*=3;
    }
    else{
      n/=3;
    }
  }
  co(3*n*n)
}
//  [cpp]
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
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;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 

vll dp(100100);

ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
 
#define comuse Comuse()
 
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
 
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
  	ci(n);
  FOR(i,0,1970000000){
    if(i%2==0){
      n*=3;
    }
    else{
      n/=3;
    }
  }
  co(3*n*n)
}
//  [c]
#include <stdio.h>

int main() {
  int r;
  scanf("%d", &r);
  printf("%d\n", 3*(r*r));

  return 0;
}
//  [c]
#include <stdio.h>
//#include <string.h>

int main(void){

  //char s[11];
  //char *a,*b;
  int r= 0;
  scanf("%d", &r);

  printf("%d", 3*r*r);

  return 0;
}
//  [c]
#include<stdio.h>
int main(void)
{
    int r;
    
    scanf("%d",&r);
    printf("%d\n",3*r*r);
  
    return 0;
}
//  [javascript]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fs = require("fs");
var input = fs.readFileSync("/dev/stdin", "utf8");
var r = parseInt(input, 10);
console.log(3 * r * r);
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	input = input.split("\n"); // 1行目がinput[0], 2行目がinput[1], …に入る
    // ここに処理を書く
    var r = input[0]
    
    var ans = 3 * r * r
	// console.logは標準出力に1行出力します (自動的に最後に改行が入ります)
	console.log(ans);
}

// ※この行以降は編集しない (標準入力から一度に読み込みMainを呼び出します)
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
var input = require("fs").readFileSync("/dev/stdin", "utf8");
var r = parseInt(input, 10);
console.log(3 * r * r);
//  [go]
package main

import (
	"fmt"
)

func main() {

	var r int
	fmt.Scanf("%d", &r)

	fmt.Println(3 * r * r)

}
//  [ruby]
r = gets.chomp.to_i
puts 3 * r ** 2
//  [ruby]
r = gets.to_i
puts 3*(r**2)
//  [ruby]
# input = readlines()
# a, b = input.shift().chomp.split("\s").map{|x| x.to_i}

input = gets.to_i

puts 3 * input * input
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        a:i64,
    }
    println!("{}", 3 * a * a);
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {r: usize};

    println!("{}", 3 * r * r);
}
//  [rust]
use proconio::{fastout, input};
use std::io::*;
use std::str::FromStr;

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

fn main() {
    input! {
        r: usize,
    }
    println!("{}", 3 * r * r);
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let r = readInts()

print(r[0]*r[0]*3)
//  [swift]
let r = Int(readLine()!)!
print(3 * r * r)
//  [swift]
let r=Int(readLine()!)!;print(3*r*r)
//  [typescript]
const main = lines => {
  console.log(solve(lines));
};

const solve = (lines: string[]): string => {
  const { r } = parseLines(lines);
  return (3 * r * r).toString();
};

const parseLines = (lines: string[]) => {
  const r = +lines[0];
  const obj = { r };
  debug(obj);
  return obj;
};

const debug = (message?: any, ...optionalParams: any[]) => {
  if (!!process.env.LOCAL_DEBUG) console.log(message, ...optionalParams);
};

if (!process.env.LOCAL_DEBUG) {
  const { stdin: input, stdout: output } = process;
  input.resume();
  input.setEncoding('utf8');
  const lines = [];
  require('readline')
    .createInterface({ input, output })
    .on('line', line => lines.push(line))
    .on('close', () => main(lines));
}

export default solve;
//  [typescript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
  const r = Number(lines[0]);
  console.log(3 * (r ** 2));
});
//  [typescript]
var main = function (input) {
    var r = parseInt(input);
    console.log(3 * Math.pow(r, 2));
};
// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
import sys

n = int(input())
x = [0]*n ; y = [0]*n
for i in range(n):
    x[i],y[i] = map(int, input().split())

if n == 1:
    print(1)
    sys.exit()

ans = []
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        p = x[i]-x[j]
        q = y[i]-y[j]
        count = 0
        for k in range(n):
            for l in range(n):
                if p == x[k]-x[l] and q == y[k]-y[l]:
                    count += 1
                ans.append(count)

print(n-max(ans))
//  [python]
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    def size(self, x):
        return -self.parents[self.find(x)]
    def same(self, x, y):
        return self.find(x) == self.find(y)
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    def group_count(self):
        return len(self.roots())

N = int(input())
B = [list(map(int,input().split())) for _ in range(N)]

ans = 10**10

for i in range(N):
    for j in range(N):

        if i==j:
            continue

        p = B[i][0]-B[j][0]
        q = B[i][1]-B[j][1]
        uf = UnionFind(N)

        for k in range(N):
            for l in range(N):

                if k==l:
                    continue

                if B[k][0]-B[l][0] == p and B[k][1]-B[l][1] == q:
                    uf.union(k,l)

        ans = min(ans,uf.group_count())

print(ans if N != 1 else 1)
//  [python]
#-*- coding: utf-8
#  -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_d -d test-d
oj test -d test-d -c "python abc116d.py"
oj test -d test-d -c "python abc116d.py" test-d/sample-3.in
"""
from collections import defaultdict
import sys
import math
from datetime import datetime

def sol2(n, S):
    dp = defaultdict(int)
    pre_x = None
    pre_y = None
    for i, (x, y) in enumerate(S):
        #print(x, y, pre_x, pre_y)
        if i == 0:
            pre_x, pre_y = x, y
        else:
            dp[(x - pre_x, y - pre_y)] +=1
            pre_x, pre_y = x, y
    #print(dp)
    return n - max(dp.values())


def rec(S, pre, diff, n):
    if S == None or len(S) == 0 or len(S)==n: return 0

    tugi = (pre[0]+diff[0], pre[1]+diff[1])
    print("pre:%s, diff:%s, so tugi:%s while S:%s" % (str(pre), str(diff), str(tugi), S))
    if tugi in S:
        print("hit:%s" % str(tugi))
        S.remove(tugi)
        return 1 + rec(S, tugi, diff)
    else:
        print("end")
        return 0


def sol_botsu2(n, S):
    dp = defaultdict(int)
    if n == 1:
        return 1
    # n >= 2
    mx = 0
    tugi = S[1]
    for s in S:
        if tugi == s: continue
        tmp = rec(S[1:], s, (tugi[0]-s[0], tugi[1]-s[1]))
        mx = max(tmp, mx)

    return n - mx



def sol(n, S):
    PQ = []
    for s1 in S:
        for s2 in S:
            if s1 == s2: continue
            PQ.append((s2[0] - s1[0], s2[1] - s1[1]))
    mx = 0
    for p, q in set(PQ):
        tmp = 0
        for s1 in S:
            for s2 in S:
                if s1 == s2: continue
                if (s2[0] - s1[0], s2[1] - s1[1]) == (p, q):
                    tmp += 1
        mx = max(tmp, mx)

    return n - mx

do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    #print(parsed_lines)
    n = int(parsed_lines[0][0])
    #W = [int(x) for x in parsed_lines[1]]
    S = []
    for i in range(1, n+1):
        x = int(parsed_lines[i][0])
        y = int(parsed_lines[i][1])
        S.append((x, y))
    # k = int(parsed_lines[0][1])
    # S = parsed_lines[1][0]
    # return n, k, S
    return n, S


if not do_submit:
    n, S = input_parse("""
    2
    1 1
    2 2
    """)
    #print(sol(n, S))

    n, S = input_parse("""
    3
    1 4
    4 6
    7 8
    """)
    #print(sol(n, S))

    n, S = input_parse("""
    4
    1 1
    1 2
    2 1
    2 2
    """)
    print(sol(n, S))


else:
    n = int(input())
    S = []
    for i in range(n):
        x ,y = list(map(int, input().split()))
        S.append((x, y))
    # print(sol(n, k, S))
    #S = input().strip()
    # S = input().strip()
    print(sol(n, S))