#include <stdio.h> int main() { long k,s=0; int hws(long n); for(k=2000;k<=3000;k++) if(hws(k)) s+=k; printf("%ld",s); } int hws(long n) { long x=n,t=0,k; while(x>0) { k=x%10; t=t*10+k; x/=10; } if(n==t) return 1; else return 0; }