Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

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

	counts := map[int]int{}
	for i := 0; i < 10; i++ {
		for j := 0; j < 10; j++ {
			for k := 0; k < 10; k++ {
				for l := 0; l < 10; l++ {
					s := i + j + k + l
					if s <= 50 {
						counts[s]++
					}
				}
			}
		}
	}
	// fmt.Println(counts)
	for {
		n, err := nextInt()
		if err != nil {
			break
		}
		cnt, ok := counts[n]
		if ok {
			fmt.Println(cnt)
		} else {
			fmt.Println(0)
		}
	}
}

Python: ans = []
for line in sys.stdin:
    answ = 0
    try:
        n = int(line)
    except:
        break
    for a in range(10):
        for b in range(10):
            for c in range(10):
                if 0 <= n-a-b-c <= 9:
                    answ += 1
    ans.append(answ)
print(*ans,sep="\n")

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

Python: import sys
for input in sys.stdin:
    count = 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 == int(input):
                        count += 1
    print(count)

Python: s = int(input())
results=set()
for a in range(10):
    for b in range(10):
        for c in range(10):
            d = s-a-b-c
            if d<0:break
            if d<=9: results.add((a,b,c,d))
print(len(results))

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):
                t = i + j + k + l
                c[t] += 1
for line in sys.stdin:
    print(c[int(line)])

Python: import sys

answer = [0] * 51
for a in range(10):
  for b in range(10):
    for c in range(10):
      for d in range(10):
        answer[a + b + c + d] += 1

for line in sys.stdin:
  try:
    print(answer[int(line)])
  except:
    break

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

if __name__ == '__main__':
    array = list(get_input())
    for i in range(len(array)):
        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 == int(array[i]):
                            cnt += 1
        print(cnt)
        cnt = 0

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

Python: while True:
    try:
        n=int(input())
        ans=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:ans+=1
        print(ans)
    except:break

Python: def count(num):    
    l1=[]
    for a in range (10):
        for b in range(10):
            for c in range (10):
                for d in range (10):
                    l1.append([a,b,c,d])
    l1=list(filter(lambda x: sum(x)==num,l1))
    return(len(l1))

while True:
    try:
        print(count(int(input())))
    except:
        break

Python: import itertools
while True:
	try: n=int(input())
	except EOEError: break
	ans=0
	for (i,j,k) in itertools.product(range(10),range(10),range(10)):
		ans+=(0<=n-(i+j+k)<=9)
	print(ans)

Python: a = [0 for i in range(51)]
for i in range(10):
  for j in range(10):
    for k in range(10):
      for l in range(10):
        a[i + j + k + l] += 1
while True:
  try:
    n = int(input())
    print(a[n])
    
  except EOFError:
    break

Python: while True:
	try:
		cnt=0
		i=int(input())
		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==i:
							cnt+=1
		print(cnt)
	except:
		break

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

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

Python: #!/usr/bin/env python
# -*- conding: utf-8 -*-
import sys

for line in sys.stdin.readlines():
    n = int(line.strip())
    if n > 36:
        print(0)
        continue
    elif n == 36:
        print(1)
        continue
    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 and d <= 9:
                    cnt += 1
    print(cnt)

Python: import sys
d = [sum((10 - abs(9 - i)) * (10 - abs(9 + i - j)) for i in range(j + 1)) for j in range(19)[:: -1]] + [0] * 14
[print(d[abs(18 - int(e))]) for e in sys.stdin]

Python: import sys
import math as mas

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

#for i in sys.stdin:
#	a,b=map(int,i.split())
#	print(gcd(a,b),lcm(a,b))

Python: while True:
    try:
        inVal = int(input())
        count = 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 == inVal:
                            count = count + 1
        print(count)
    except EOFError:
        break

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

Python: n=int(input())
count=0
for a in range(0,10):
    for b in range(0,10):
        for c in range(0,10):
            if 50-a-b-c>=0 and 50-a-b-c<10:
                count+=1
print(count)

Python: while True:
    try:
        n = int(input())
        counter = 0

        for o in range(10):
            for p in range(10):
                for q in range(10):
                    for r in range(10):
                        if (o + p + q + r) == n:
                            counter = counter + 1

        print(counter)
    except:
        break

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

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

Python: import sys
r = range(10)
for l in sys.stdin: print(len([[a,b,c,d]for a in r for b in r for c in r for d in r if a+b+c+d==int(l)]))