#include <iostream>
#include <string>
using namespace std;

const int daylist[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int main() {
    int cnt = 0;
    for (int i = 0; i < 12; ++i) {
        for (int j = 1; j <= daylist[i]; ++j) {
            int check = 0;
            for (char c : to_string(j)) {
                check += c - '0';
            }
            if (check == i + 1) {
                ++cnt;
                // cout << i + 1 << " " << j << endl;
            }
        }
    }
    cout << cnt << endl;
}