#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>


//static unsigned char Ret(){
//	uint8_t c1 = 0;
//	for(c1=0; c1<16; c1++){
//		
//	}
//}

int main(int argc, char **argv){
	uint8_t c[16];
	uint8_t c1 = 0;
	uint8_t sum = 0;
	uint32_t matches = 0;

	for(c[0]=0; c[0]<16; c[0]++){
		for(c[1]=0; c[1]<16; c[1]++){
			for(c[2]=0; c[2]<16; c[2]++){
				for(c[3]=0; c[3]<16; c[3]++){
					for(c[4]=0; c[4]<16; c[4]++){
						for(c[5]=0; c[5]<16; c[5]++){
							for(c[6]=0; c[6]<16; c[6]++){
								for(c[7]=0; c[7]<16; c[7]++){
									for(c[8]=0; c[8]<16; c[8]++){
										for(c[9]=0; c[9]<16; c[9]++){
											for(c[10]=0; c[10]<16; c[10]++){
												for(c[11]=0; c[11]<16; c[11]++){
													for(c[12]=0; c[12]<16; c[12]++){
														for(c[13]=0; c[13]<16; c[13]++){
															for(c[14]=0; c[14]<16; c[14]++){
																for(c[15]=0; c[15]<16; c[15]++){
																	sum = 0;
																	for(c1=0; c1<16; c1++){
																		sum += c[c1];
																		if(sum > 16)
																			break;
																	}
																	if(sum == 16){
																		matches++;
																		//for(c1=0; c1<16; c1++){
																		//	printf("%u ", c[c1]);
																		//}
																		//printf("\n");
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}

	printf("Matches: %u\n", matches);
	return 0;
}