stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<iostream>

#include<stdio.h>

#include<math.h>

#include<algorithm>

using namespace std;

int n,m;  int map[13][100003];  int book[13]; int ans; int newmap[13][100003]; int max0,max1; int preans;

void answer();

void dfs(int x)

{

	if(x==n+1) answer();

	else 

	{

		for(int i=0;i<2;i++)

		{

			book[x]=i;

			dfs(x+1);

		}

	}

}



void answer()

{

	 preans=0;

    

	for(int i=1;i<=n;i++)

	{

		if(book[i])

		for(int j=1;j<=m;j++)

		{

			newmap[i][j]=(map[i][j]+1)%2;

		}

		else 

		for(int j=1;j<=m;j++)

		{

			newmap[i][j]=map[i][j];

		}

	}



	for(int i=1;i<=m;i++)

	{

		for(int j=1;j<=n;j++)

		{

			if(newmap[j][i]==0)  max0++;

			else max1++;

		}

		 preans+=max(max0,max1);

		 max1=0; max0=0;

	}

	ans=max(ans,preans);

}





int main()

{

   	while(~scanf("%d%d",&n,&m)&&n!=0)

   	{

   		   ans=0; preans=0;

			 for(int i=1;i<=n;i++)

   		  {

   		     for(int j=1;j<=m;j++)

			 scanf("%d",&map[i][j]);	

		  }

       for(int i=0;i<2;i++)

       {

       	  book[1]=i;

       	  dfs(2);

	   }

	   cout<<ans<<endl;

	}

	return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

const int MAXR = 10;

const int MAXC = 10000;

int R, C;

int a[MAXR][MAXC];

#include <algorithm>

void reverse(int x) {

    for (int i = 0; i < C; ++i)

        a[x][i] = !a[x][i];

}

int dfs(int cur) {

    int ans = 0;

    if (cur == R) {

        for (int j = 0; j < C; ++j) {

            int cnt = 0;

            for (int i = 0; i < R; ++i)

                cnt += a[i][j];

            ans += std::max(cnt, R - cnt);

        }

    }

    else {

        ans = dfs(cur + 1);

        reverse(cur);

        ans = std::max(ans, dfs(cur + 1));

        //reverse(cur);

    }

    return ans;

}

int solve() {

    return dfs(0);

}

int main() {

    while (scanf("%d%d", &R, &C), R) {

        for (int i = 0; i < R; ++i)

            for (int j = 0; j < C; ++j)

                scanf("%d", &a[i][j]);

        printf("%d\n", solve());

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <cmath>

#include <iomanip>

#include <vector>

#include <map>

#include <cstring>

#include <algorithm>

using namespace std;



struct Coordinate{

    int row;

    int col;

};

Coordinate mov_dir[4] = {{1, 0}, {0, -1}, {-1, 0}, {0, 1}};

bool mat[11][10001], one[11];

int R, C, ans;



void dfs(int row, bool flag)

{

    if (row == 10) {

        return;

    }

    if (flag) {

        for (int j = 0; j < C; j++) {

            mat[row][j] = !mat[row][j];

        }

    }

    for (int i = 0; i < C; i++) {

        int cnt_o = 0, cnt_z = 0;

        for (int j = 0; j < R; j++) {

            if (mat[j][i] == 1) {

                cnt_o++;

            }

            else {

                cnt_z++;

            }

        } 

        if (cnt_z > cnt_o) {

            for (int j = 0; j < R; j++) {

                mat[j][i] = !mat[j][i];

            }

        }

    }

        int cnt = 0;

        for (int i = 0; i < R; i++) {

            for (int j = 0; j < C; j++) {

                if (mat[i][j]) {

                    cnt++;

                }

            }

        }

    if (ans < cnt) {

        ans = cnt;

    }    

    dfs(row + 1, true);

    dfs(row + 1, false);



}

int main()

{

    ios::sync_with_stdio(false);

    cin.tie(0);

    

    while (cin >> R >> C && !(R == 0 && C == 0)) {

        ans = -1;

        for (int i = 0; i < R; i++) {

            int cnt_o = 0, cnt_z = 0;

            for (int j = 0; j < C; j++) {

                cin >> mat[i][j];

            }    

        }

        dfs(0, true);

        dfs(0, false);



        cout << ans << endl;

    }

    return 0;

}




// Optimized solution to the same problem (faster):
/*

 * 题目: Aizu - 0525 

 * 题意: 

 * 类型: 

 * 算法：暴力搜索

 * Date: 2020-07-07 09:37:58

 * LastEditors: loeije

 * LastEditTime: 2020-07-08 07:01:33

*/



#include <cstdio>

#include <cmath>

#include <algorithm>

using namespace std;



const int maxn = 1024 + 10;

const int row = 10 + 5, col = 10000 + 5;

int grid[row][col];

int r, c, ans = 0;



void process(int idx) {

    if(idx == r) {

        int sum = 0;

        for(int i = 0; i < c; ++i) {

            int tempsum = 0;

            for(int j = 0; j < r; ++j) {

                if(grid[j][i] == 1) {

                    tempsum++;

                }

            }



            sum += max(tempsum, r - tempsum);

        }

        ans = max(ans, sum);

        return ;

    }



    process(idx + 1);

    for(int i = 0; i < c; ++i) grid[idx][i] = !grid[idx][i];

    process(idx + 1);

}



int main() {

    while(scanf("%d%d", &r, &c) && (r + c != 0)) {

        for(int i = 0; i < r; ++i) {

            for(int j = 0; j < c; ++j) {

               scanf("%d", &grid[i][j]); 

            }

        }



        // process

        ans = 0;

        process(0);

        

        printf("%d\n", ans);

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m){for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}N=N>n?N:n;}main(){for(;std::cin>>R>>C,R|C;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)std::cin>>s[i][j];}

// Optimized solution to the same problem (faster):
#include<cstdio>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;scanf("%d%d",&R,&C),R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;std::cin>>R>>C,R|C;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);scanf("%d",s[i]+j);}

// Optimized solution to the same problem (faster):
#include<cstdio>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;scanf("%d%d",&R,&C),R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;std::cin>>R>>C,R|C;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}

// Optimized solution to the same problem (faster):
#include<cstdio>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;scanf("%d%d",&R,&C),R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;std::cin>>R>>C,R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)std::cin>>s[i][j];}

// Optimized solution to the same problem (faster):
#include<cstdio>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;scanf("%d%d",&R,&C),R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<math.h>

using namespace std;



int r,c;

bool state[10][10000];

bool linemap[10][10000];

int mapcount;

int getnum(bool status[10][10000]){

	int num=0;

	for(int i=0;i<r;i++){

		for(int j=0;j<c;j++){

			if(status[i][j])num++;

		}

	}

	return num;

}



void adjust(){

	

		for(int j=0;j<c;j++){

			int num0=0,num1=0;

			for(int k=0;k<r;k++){

				if(linemap[k][j])num1++;

				else num0++;

			}

			if(num0>num1){

				for(int k=0;k<r;k++){

					linemap[k][j]=1-linemap[k][j];

				}

			}

		}

	

}

int creatlinemap(){

	int max=0;

	for(int i=0;i<mapcount;i++){

		for(int j=0;j<r;j++){

			if(i&(1<<j)){

				for(int k=0;k<c;k++){

					linemap[j][k]=state[j][k];

				}

				

			}

			else{

				for(int k=0;k<c;k++){

					linemap[j][k]=1-state[j][k];

				}

			}

		}

		adjust();

		int tmp=getnum(linemap);

		if(tmp>max)	max=tmp;			

	}

	return max;	

}





int main(){



	while(cin>>r>>c){

		if(r*c==0)return 0;

		mapcount=(int)pow(2.0,r);

		for(int i=0;i<r;i++){

			for(int j=0;j<c;j++){

				cin>>state[i][j];

			}

		}

		

		cout<<creatlinemap()<<endl;

	}

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



#define maxRow 10

#define maxCol 10000

int rows,cols;

int a[maxRow][maxCol];

int r[maxRow];

int max_num=0;



void dfs(int step){

	if(step == rows){

		int num,total=0;

		for(int j = 0; j < cols; j++)

		{

			num = 0;

			for(int i = 0; i < rows; i++){

				if(r[i] == -1 && a[i][j] == 0)num++;

				else if(r[i] == 1 && a[i][j] == 1)num++;

			}

			if(num > rows/2)total += num;

			else total += (rows - num);

		}

		if(total > max_num)max_num = total;



	}

	else{

		r[step] = -1;dfs(step+1);

		r[step] = 1;dfs(step+1);

	}

}



int main(){

	while(scanf("%d%d",&rows,&cols),rows||cols){

		max_num = 0;

		for(int i = 0; i < rows; i++)

			for(int j = 0; j < cols; j++)

				scanf("%d",&a[i][j]);

		dfs(0);

		printf("%d\n",max_num);

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>



using namespace std;

int r, c;

int Osenbei[10][10000];

int sum = 0;



void dfs(int roral) {

	if (roral == r) {

		int result = 0;

		for (int j = 0; j < c; ++j) {

			int num = 0;

			for (int i = 0; i < r; ++i) {

				if (Osenbei[i][j])

					++num;

			}

			result += max(num, r - num);

		}

		sum = max(result, sum);

		return;

	}

	dfs(roral + 1);



	

	for (int j = 0; j < c; ++j) {

		Osenbei[roral][j] = 1 - Osenbei[roral][j];

	}



	dfs(roral + 1);



	for (int j = 0; j < c; ++j) {

		Osenbei[roral][j] = 1 - Osenbei[roral][j];

	}





	return;

}



int  main() {

	while (true) {

		cin >> r >> c;

		if (c == 0) {

			break;

		}

		for (int i = 0; i < r; ++i) {

			for (int j = 0; j < c; ++j)

			{

				cin >> Osenbei[i][j];

			}

		}

		dfs(0);

		cout << sum << endl;

	}

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



#define maxRow 10

#define maxCol 10000

int rows,cols;

int a[maxRow][maxCol];

int r[maxRow];

int max_num=0;



void dfs(int step){

	if(step == rows){

		int num,total=0;

		for(int j = 0; j < cols; j++)

		{

			num = 0;

			for(int i = 0; i < rows; i++){

				if(r[i] == -1 && a[i][j] == 0)num++;

				else if(r[i] == 1 && a[i][j] == 1)num++;

			}

			if(num > rows/2)total += num;

			else total += (rows - num);

		}

		if(total > max_num)max_num = total;



	}

	else{

		r[step] = -1;dfs(step+1);

		r[step] = 1;dfs(step+1);

	}

}



int main(){

	while(scanf("%d%d",&rows,&cols),rows||cols){

		max_num = 0;

		for(int i = 0; i < rows; i++)

			for(int j = 0; j < cols; j++)

				scanf("%d",&a[i][j]);

		dfs(0);

		printf("%d\n",max_num);

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define IO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

const int inf = 0x3f3f3f3f;

typedef long long ll;

#define ull unsigned long long

const int maxn = 1e5+10;

const ll mod=1e9+7;

#define MAXN 40100

ll gcd(ll T, ll b) { return b == 0 ? T : gcd(b, T % b); }

ll lcm(ll T, ll b) { return T / gcd(T, b) * b; }

ll mul(ll a,ll b, ll c) {

    ll ans = 0;

    while(b) {

        if(b&1) {

            ans= (ans+a)%c;

            b--;

        }

        b>>=1;

        a=(a+a)%c;

    }

    return ans;

}

 

ll powmod(ll a,ll b,ll c) {

    ll ans = 1;

    while(b) {

        if(b&1) {

            ans = mul(ans,a,c);

            b--;

        }

        b>>=1;

        a=mul(a,a,c);

    }

    return ans ;

}

 

ll exgcd(ll a,ll b,ll &x,ll &y) {

    if(b==0)

    {

        x=1;y=0;

        return a; 

    }

    ll r=exgcd(b,a%b,x,y);

    ll temp=y;

    y=x-(a/b)*y;

    x=temp;

    return r;

}



int main() {

    ull a,ans;

    char s[6];

    cin>>a>>s;

    ans=(s[0]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0'); 

    cout<<a*ans/100<<endl;

    return 0;



}


// Optimized solution to the same problem (faster):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

char s[10];

int main(){

	long long x;

	cin>>x;

	cin>>s;

	long long y;

	y=(s[0]-'0')*100+(s[2]-'0')*10+(s[3]-'0');

	long long z=x*y/100;

	printf("%lld\n",z); 

	return 0;

} 

// Optimized solution to the same problem (faster):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    unsigned long long num;

    double frac;

    while(cin>>num>>frac)

    {

        long long con=(frac*100)+0.5;

       // unsigned long long sol=(frac*num);

       unsigned long long sol=(num*con)/100;

        cout<<sol<<endl;

        

    }

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define ll long long

using namespace std;

const int N = 1e3 + 10;



signed main() {

	// ios::sync_with_stdio(false);

	ll a, b, c;

	scanf("%lld %lld.%lld", &a, &b, &c);

	b = b * 100 + c;

	ll x = a * b;

	string ans;

	while (x) ans += x % 10 + '0', x /= 10;

	if (ans.size() <= 2) printf("0\n");

	else {

		for (int i = ans.size() - 1; i > 1; i--)

			printf("%c", ans[i]);

		printf("\n");

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

using namespace std;

int main(){

	long long a;

	double b;

	cin>>a>>b;

	b=b*(100+0.1);

	a*=(int)b;

	cout<<a/100<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

long long int a, s;

int b, c;

cin>>a;

scanf("%d.%d", &b, &c);

b=b*100+c;

s=b*a/100;

cout<<s<<endl;

return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<string>

using namespace std;

int main()

{

	string s;

	long long  n,p;

	while (cin>>n>>s)

	{

		int l = s.length();

		int b, m;

		b = m = -1;

		for (int i = 0; i < l; i++)

		{

			if (s[i] != '0')

			{

				b = i;

				break;

			}

		}

		for (int i = b; i < l; i++)

		{

			if (s[i] == '.')

			{

				m = i;

				break;

			}

		}

		p = 0;

		if (m != -1)

		{

			for (int i = l-1; i > m; i--)

			{

				p = (s[i] - '0') * n + p;

				p = p / 10;

			}

		}

		if (b != -1)

		{

			if (b == m)

				cout << p << endl;

			else

			{

				for (int i = m-1; i >= b; i--)

				{

					p = (s[i] - '0') * n + p;

					s[i] = p % 10;

					p /= 10;

				}

				

				if (p)

				{

					cout << p;

				}

				for (int i = b; i < m; i++)

				{

					cout << (int)s[i];

				}

				cout << endl;

			}

		}

	}

	return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<iostream>

#include<cstring>

 

using namespace std;

//初始化 

void initial(string &a, string &b){

	while (a.size()<b.size())a = '0' + a;

	while (b.size()<a.size())b = '0' + b;

}

//找出最大的字符串 

void findMax(string &a, string &b){

	string tmp;

	if (a<b){

		tmp = b;

		b = a;

		a = tmp;

	}

}

//删除第一个字符'0' 

bool del(string &a){

	if (a[0] == '0'){

		a.erase(0, 1);

		return true;

	}

	else

		return false;

}

//删除前面所有的 0 

void delAllZroe(string &a){

	while (del(a)){

		del(a);

	};

}

//大数加法 

string bigItergeAdd(string a, string b){

	initial(a, b);

	a = '0' + a;

	b = '0' + b;

	for (int i = a.size() - 1; i >= 0; i--){

		int num1 = a[i] - '0';

		int num2 = b[i] - '0';

		if (num1 + num2>9){

			a[i - 1] = a[i - 1] - '0' + 1 + '0';

			a[i] = (num1 + num2) - 10 + '0';

		}

		else{

			a[i] = (num1 + num2) + '0';

		}

	}

	del(a);

	//	cout<<a<<endl;

	return a;

}

//大数乘法(大数加法实现) 

void bigItergeMul(string a, string b){

	delAllZroe(a);

	delAllZroe(b);

	if (a == "" || b == ""){ printf("0\n"); return; }

	initial(a, b);

	findMax(a, b);

	string res = "0";

	int count = 0;

	delAllZroe(b);

	for (int i = b.size() - 1; i >= 0; i--){

		int num1 = b[i] - '0';

		if (i != b.size() - 1)		a = a + '0';

		for (int i = 1; i <= num1; i++){

			res = bigItergeAdd(res, a);

		}

	}

	delAllZroe(res);

	if (res.size()<3){ printf("0\n"); return; }

	res=res.erase(res.size()-2,2);

	cout << res << endl;

}

 

int main(){

	string a, b, t=".";

	cin>>a>>b;

	int p=b.find(t);

	b=b.erase(p,1);

	bigItergeMul(a,b);	

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cmath>

#include <cstdlib>

#include <iostream>

#include <bitset>

#include <deque>

#include <list>

#include <map>

#include <set>

#include <queue>

#include <stack>

#include <vector>

#include <algorithm>

#include <iterator>

#include <string>

#include <chrono>

#include <random>

#include <tuple>

#include <utility>

#include <fstream>

#include <complex>

#include <cstdint>

#define _USE_CMATH_DEFINES



const long INF = (1l << 30);

const long LINF = (1l << 60); //1.15*10^18



long a;

std::string s;



int main(){

    std::cin >> a >> s;

    //std::cout << a << '!' << s << std::endl;

    long c = (s[0] - '0') * 100 + (s[2] - '0') * 10 + (s[3] - '0');

    //printf("%ld\n", c);

    printf("%ld\n", a * c / 100);

}


// Optimized solution to the same problem (faster):
#include <cstdio>



int main(){

  long a, b, c;

  scanf("%ld %ld.%ld", &a, &b, &c);

  printf("%ld\n", a*(b*100+c)/100);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

 

int main(){

  long long int a;

  double b;

  cin >> a >> b;

  int c=b*100+0.5;

  cout << a*c/100 << endl;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

 

int main(){

  long a, b, c;

  scanf("%ld %ld.%ld", &a, &b, &c);

  printf("%ld\n", a*(b*100+c)/100);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<map>

#include<string>

#include<cstdio>

typedef long long ll;

const ll inf = 1e18; 

using namespace std;



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	long double a;

	long double b;

	cin>>a>>b;

	cout<<(ll)(a*b)<<endl;

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

typedef long long ll;

int main()

{

	ll a,b;

	char s[5];

	scanf("%lld%s",&a,&s);

	b=(s[0]-'0')*100+(s[2]-'0')*10+(s[3]-'0');

	printf("%lld\n",a*b/100);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <cstring>

#include <cmath>

#include <utility>

#include <iostream>

#include <functional>

#include <bitset>

#include <algorithm>

#include <vector>

#include <forward_list>

#include <set>

#include <map>

#include <queue>

#include <deque>

#include <stack>

#include <numeric>

#include <iomanip>  //setprecision(桁)

using namespace std;

#define pb push_back

#define rep(i,n) for(int i = 0;i < n;i++)

#define INF 1e+9



struct edge {

    int to;

    double cost;

};



// <最短距離, 頂点の番号>

using P = pair<double, int>;



int V;

const int ci = 2e5+ 5;

vector<edge> G[ci];

double d[ci];



void dijkstra(int s) {

    priority_queue<P, vector<P>, greater<P> > que;

    fill(d, d+V, INF);

    d[s] = 0;

    que.push(P(0, s));



    while (!que.empty()) { //cout << "On" << endl;

        P p = que.top();

        que.pop();

        int v = p.second; //cout << "v=" << v << endl;

        if (d[v] < p.first) continue;

        for (int i=0; i<G[v].size(); i++) {

            edge e = G[v][i]; //cout << "koo" << endl;

            if (d[e.to] > d[v] + e.cost) { //cout << e.cost << endl;

                d[e.to] = d[v] + e.cost;

                que.push(P(d[e.to], e.to));

            }

        }

    }

}



int main(){

    long double a,b; cin >> a >> b;

    long long int ans = a * b;

    cout << ans << endl;

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <string>

#include <vector>

#include <algorithm>

#include <utility>

#include <tuple>

#include <cstdint>

#include <cstdio>

#include <map>

#include <queue>

#include <set>

#include <stack>

#include <deque>

#include <unordered_map>

#include <unordered_set>

#include <bitset>

#include <cctype>

#include <numeric>

#include <cmath>

#include <iomanip> //cout << fixed << setprecision(15) << << endl;

#include <cassert>

//#include "atcoder/all"



using namespace std;

//using namespace atcoder;



typedef long long ll;



#define pb push_back

#define rep(i, n) for(int i=0;i<(n);i++)

#define REP(i, n) for(int i=1;i<=(n);i++)

#define P pair<int,int>



int mx8[] = {0, 0, 1, -1, -1, 1, -1, 1};

int my8[] = {-1, 1, 0, 0, -1, -1, 1, 1};

int mx4[] = {1, -1, 0, 0};

int my4[] = {0, 0, -1, 1};



const int MOD = 1000000007;



int main() {

    ios::sync_with_stdio(false);



    ll a; double b; cin >> a >> b;

    ll b1 = b*100 + 0.5;

    ll ans = a * b1 / 100;

    cout << ans << endl;

}

// Fastest known solution for this problem: