Go: package main

import "fmt"

func main() {
	var n int

	for {
		result := 0
		_, err := fmt.Scanf("%d", &n)
		if err != nil {
			return
		}

		if n <= 36 {
			for a := 9; a >= 0; a-- {
				for b := 9; b >= 0; b-- {
					for c := 9; c >= 0; c-- {
						for d := 9; d >= 0; d-- {
							if a+b+c+d == n {
								// fmt.Println(a, b, c, d)
								result++
							}
						}
					}
				}
			}
		}
		fmt.Println(result)
	}
}

Python: while True:
    try:
        n=int(input())
    except:
        break
    cnt=0
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    if i+k+j+l==n:
                        cnt+=1
    print(cnt)

Python: 
while True:
	try:
		n=int(input())
		cnt=0
		for a in range(10):
			for b in range(10):
				for c in range(10):
					d = n-(a+b+c)
					if 0<=d<=9:
						cnt+=1
		print(cnt)
	except EOFError:
		break

Python: import sys
from itertools import product

num = 4
l = [0] * (9*num + 1)
for x in map(sum, product(range(10), repeat=num)):
    l[x] += 1

for s in sys.stdin:
    print(l[int(s)])

Python: import sys
lines = sys.stdin.readlines()
for line in lines:
    inp = int(line)
    s = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                for d in range(10):
                    if a+b+c+d==inp:
                        s+=1
    print (s)

Python: import sys

p = [0] * 51
v = 0
for i in range(19):
    t = (i+3)*(i+2)*(i+1)//6
    v = v + 2 * (i-8) * (i-9) if i > 9 else 0
    p[i] = t - v
    p[36-i] = p[i]

for i in sys.stdin:
    print(p[int(i)])

Python: import sys
a=[0]*51;x=range(10)
for i in range(51):
 a[i]=sum([1 for p in x for q in x for r in x for s in x if p+q+r+s==i])
for e in sys.stdin:
 print(a[int(e)])

Python: 
while True:
	try:
		n=int(input())
		cnt=0
		for a in range(10):
			if a<=n:
				for b in range(10):
					if b<=n:
						for c in range(10):
							if c<=n:
								d = n-(a+b+c)
								if 0<=d<=9:
									cnt+=1
								else:
									break
					else:
						break
			else:
				break
		print(cnt)
	except EOFError:
		break

Python: import sys
[print(sum([1 if sum([a, b, c, d]) == int(x) else 0 for a in range(10) for b in range(10) for c in range(10) for d in range(10)])) for x in sys.stdin]

Python: e=[0]*51
for a in range(10):
  for b in range(10):
    for c in range(10):
      for d in range(10):
        e[sum([a,b,c,d])]+=1
while 1:
  try:
    print(e[int(input())])
  except:
    break

Python: import sys
import itertools

def main():
    l = list(range(10))
    
    while True:
        data = sys.stdin.readline().strip()
        if data is None or data == '':
            break

        num = int(data)
        #print('num:', num)
        cnt = 0
        for elem in itertools.product(l, repeat=4):
            sum = 0
            for i in elem:
                sum += i

            if sum == num:
                cnt += 1

        print(cnt)

if __name__ == '__main__':
    main()

Python: import sys
c = [0 for i in range(37)]
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                c[i+j+k+l] += 1
for line in sys.stdin:
    n = int(line)
    print(c[n])

Python: import sys

def getsum(n):
  if n > 36: return 0
  else:
    i = n if n < 19 else 36-n
    return (i+3)*(i+2)*(i+1)//6 - max(2*(i-9)*(i-8)*(i-7)//3,0)

for i in sys.stdin:
    print(getsum(int(i)))

Python: #! /usr/bin/python3

s=int(input())
n=0
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                if s == i+j+k+l: n+=1
print(n)

Python: import sys
for e in sys.stdin:
 x=range(10)
 print(sum([1 for a in x for b in x for c in x for d in x if a+b+c+d==int(e)]))

Python: n=int(input())
count=0
for a in range(10):
	for b in range(10):
		for c in range(10):
			for d in range(10):
				ans = a + b + c + d 
				if(n == ans):
					count += 1 
print(count)

Python: def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    n = int(N[l])
    ans = 0
    for a in range(min(n+1,10)):
        for b in range(min(n+1-a,10)):
            for c in range(min(n+1-a-b,10)):
                for d in range(min(n+1-a-b-c,10)):
                    if a+b+c+d == n:
                        #print(a,b,c,d)
                        ans = ans + 1
    print(ans)

Python: import sys

p = [0] * 51
for i in range(10):
    p[i] = p[36-i] = (i+3)*(i+2)*(i+1)//6

for i in range(10,19):
    p[i] = p[36-i] = (i+1)*(i+2)*(i+3)//6 - 2*(i-9)*(i-8)*(i-7)//3

for i in sys.stdin:
    print(p[int(i)])

Python: import sys
a=[0]*51
for i in range(19):a[i]=a[36-i]=(i+3)*-~-~i*-~i//6-a[i-10]*4*(i>9)
for e in sys.stdin:print(a[int(e)])

Python: import itertools
while True:
    try:
        n = int(input())
        ans = 0
        for a in itertools.product(range(10), repeat=4):
            if n == sum(a):
                ans += 1
        print(ans)
    except:
        break

Python: num=int(input())
sum=0
Range=10
for a in range(Range):
    for b in range(Range):
        for c in range(Range):
            for d in range(Range):
                if num==a+b+c+d:
                    sum+=1
print(sum)

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main(): 
	num = int(input())
	if num >= 19:
		num = 19 - num + 17
	res = 1
	gro1 = 3
	for i in range(8):
		if i == num:
			return res
		if i == 0:
			gro2 = 3
		else:
			gro2 += 1
		res += gro1
		gro1 += gro2
	
	for i in range(8,19):
		if i == num:
			return res
		gro2 -= 3
		res += gro1
		gro1 += gro2
			
		
if __name__ == '__main__':
	print(main())

Python: try:
    while True:
        #標準入力
        num = int(input())
        kei = 0
        #全パターン試す
        for num1 in range(0,10):
            for num2 in range(0,10):
                for num3 in range(0,10):
                    for num4 in range(0,10):
                        #合計が入力値と同じならカウントを増やす
                        if num1 + num2 + num3 + num4 == num:kei += 1
                        else:pass
        #出力
        print(kei)
#EOFErrorをひろう
except EOFError:
    pass

Python: while True:
	try:
		n = eval(input())
		if n > 36:
			print(0)
		else:
			count = 0
			for a in range(0, 10):
				for b in range(0, 10):
					for c in range(0, 10):
						for d in range(0, 10):
							if a + b + c + d == n:
								count += 1
			print(count)
	except EOFError:
		break

Python: import sys
import math

def case(a,b):
	return math.factorial(a+b)/(math.factorial(a)*math.factorial(b))

while True:
	try:
		n = int(input())
		if n >= 37:
			print('0')
		elif n >= 10 and n <= 18:
			print(int(case(n,3)-3*case(n-9,2)))
		elif n >= 19 and n <= 27:
			print(int(case(n,3)-3*case(n-9,2)-3*case(n-18,1)))
		elif n >= 28 and n <= 36:
			print(int(case(36-n,3)))
		else:
			print(int(case(n,3)))	
	except EOFError:
		break

Python: ss = int(input())
r = 10
while 1:
	cnt = 0
	for a in range(r):
		for b in range(r):
			for c in range(r):
				for d in range(r):
					if a+b+c+d==ss: cnt+=1
	print(cnt)
	try: ss = int(input())
	except EOFError: break

Python: while True:
    try:
        n=int(input())
    except:
        break
    s=0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                for d in range(10):
                    if a+b+c+d==n:
                        s+=1
    print(s)

Python: import sys; print("\n".join(str(sum(1 for n in [int(in_n)] for a in range(10) for b in range(a, a+10) for c in range(b, b+10) for d in range(c, c+10) if d == n)) for in_n in sys.stdin))