#include <iostream>
using namespace std;
int s[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
int a, b, c;
while (~scanf("%d/%d/%d", &a, &b, &c)) {
if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0)
s[1] = 29;
else
s[1] = 28;
int ans = 0;
for (int i = 0; i < b - 1; i ++ )
ans += s[i];
ans += c;
cout << ans << endl;
}
return 0;
}
#include <iostream>
#include <cstring>
using namespace std;
const int N = 1e5;
char m[N];
void solve(int a, int b) {
int cnt = -1;
memset(m, 0, sizeof (m));
while (a) {
m[++ cnt] = a % b < 10 ? (a % b + 48) : (a % b + 55);
a /= b;
}
for (int i = cnt; i >= 0; i -- )
cout << m[i];
cout << endl;
}
int main() {
int n, r;
while (cin >> n >> r) {
if (n >= 0) {
solve(n, r);
} else {
cout << '-';
solve(-n, r);
}
}
return 0;
}
#include <iostream>
using namespace std;
int solve(int x) {
int ans = 0;
for (int i = 1; i < x; i ++ )
if (x % i == 0)
ans += i;
return ans;
}
int main() {
int t;
cin >> t;
while (t -- ) {
int a, b;
cin >> a >> b;
if (solve(a) == b && solve(b) == a)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}
#include <iostream>
using namespace std;
typedef long long LL;
LL a[60];
void solve() {
a[1] = 1;
a[2] = 2;
for (int i = 3; i < 60; i ++ )
a[i] = a[i - 1] + a[i - 2];
}
int main() {
solve();
int t;
while (cin >> t) {
while (t -- ) {
int n, m;
cin >> n >> m;
cout << a[m - n] << endl;
}
}
return 0;
}
#include <iostream>
using namespace std;
int main() {
int n;
while (cin >> n) {
int ans = 1;
for (int i = 1; i < n; i ++ ) {
ans = (ans + 1) * 2;
}
cout << ans << endl;
}
return 0;
}